docs: use the correct CURLOPT_WRITEFUNCTION signature

In order to not encourage users to use incompatible function pointers,
change the callback function definitions to use `char *` instead of
`void *` for the first argument.

Triggered by https://stackoverflow.com/questions/79921871/curl-c-c-library-based-application-produces-erronious-response-for-http-post-r#comment141032037_79921871 :

"The code was mostly modified from
 [this example code](https://curl.se/libcurl/c/postinmemory.html),
 honestly I never knew this is wrong. Thanks for pointing it out."

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Closes #21265
This commit is contained in:
Ted Lyngmo 2026-04-08 09:15:03 +02:00 committed by Daniel Stenberg
parent 80b2a5dd37
commit 135665036f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
26 changed files with 27 additions and 27 deletions

View file

@ -80,7 +80,7 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info)
return true;
}
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
static size_t wrfu(char *ptr, size_t size, size_t nmemb, void *stream)
{
(void)stream;
(void)ptr;