]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example
authorDaniel Stenberg <daniel@haxx.se>
Mon, 7 Nov 2022 11:15:24 +0000 (12:15 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 7 Nov 2022 11:48:39 +0000 (12:48 +0100)
Reported-by: Oskar Sigvardsson
Bug: https://curl.se/mail/lib-2022-11/0016.html

Closes #9862

docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.3

index d7442d4cde26776090d7a729442a0f805d51d2c1..505be6751492257d19485ca4c8280505375b3b16 100644 (file)
@@ -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;