mirror of
https://github.com/curl/curl.git
synced 2026-05-30 08:27:28 +03:00
tool_cb_hdr: fix fwrite check in header callback
Compare fwrite result to nmemb (items), not cb (bytes). Closes #18593
This commit is contained in:
parent
a827e4294c
commit
20f757ef14
1 changed files with 1 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||
|
||||
if(per->config->headerfile && heads->stream) {
|
||||
size_t rc = fwrite(ptr, size, nmemb, heads->stream);
|
||||
if(rc != cb)
|
||||
if(rc != nmemb)
|
||||
return rc;
|
||||
/* flush the stream to send off what we got earlier */
|
||||
if(fflush(heads->stream)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue