From: Daniel Stenberg Date: Mon, 7 Nov 2022 11:15:24 +0000 (+0100) Subject: CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example X-Git-Tag: curl-7_87_0~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec4eec222b4ccc48c3f711b3cad31d9026919d46;p=thirdparty%2Fcurl.git CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example Reported-by: Oskar Sigvardsson Bug: https://curl.se/mail/lib-2022-11/0016.html Closes #9862 --- diff --git a/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.3 b/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.3 index d7442d4cde..505be67514 100644 --- a/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.3 +++ b/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.3 @@ -125,7 +125,8 @@ int my_trace(CURL *handle, curl_infotype type, switch (type) { case CURLINFO_TEXT: - fprintf(stderr, "== Info: %s", data); + fputs("== Info: ", stderr); + fwrite(data, size, 1, stderr); default: /* in case a new one is introduced to shock us */ return 0;