]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_READFUNCTION.md: clarify the size of the buffer
authorDaniel Stenberg <daniel@haxx.se>
Sat, 8 Nov 2025 11:43:24 +0000 (12:43 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 8 Nov 2025 16:11:28 +0000 (17:11 +0100)
No need to multiply with size as size is always 1 - and documented so.

Closes #19402

docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md
docs/libcurl/opts/CURLOPT_READFUNCTION.md

index 8e16b78d5552f4b10e870bce048b34a84ed0cce0..060ebf5bddc3ae4d5b2d3a14bc7171aa1f7f1f1f 100644 (file)
@@ -109,7 +109,7 @@ Nothing.
 static size_t header_callback(char *buffer, size_t size,
                               size_t nitems, void *userdata)
 {
-  /* received header is 'nitems' bytes in 'buffer' NOT ZERO TERMINATED */
+  /* received header is 'nitems' bytes in 'buffer' NOT NULL-TERMINATED */
   /* 'userdata' is set with CURLOPT_HEADERDATA */
   return nitems;
 }
index 71ad2e9ca0fd0f6e5ec1085b4deafd1c50a90625..0046ded635c8d37ff9448c2e862f8d78f550b2a9 100644 (file)
@@ -36,9 +36,8 @@ Pass a pointer to your callback function, as the prototype shows above.
 
 This callback function gets called by libcurl as soon as it needs to read data
 in order to send it to the peer - like if you ask it to upload or post data to
-the server. The data area pointed at by the pointer *buffer* should be
-filled up with at most *size* multiplied with *nitems* number of bytes
-by your function. *size* is always 1.
+the server. The data area pointed at by the pointer *buffer* should be filled
+up with at most *nitems* number of bytes by your function. *size* is always 1.
 
 Set the *userdata* argument with the CURLOPT_READDATA(3) option.