]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: fix error message for partial file upload
authorJay Satiro <raysatiro@yahoo.com>
Tue, 29 Mar 2022 19:05:47 +0000 (15:05 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 1 Apr 2022 17:52:13 +0000 (13:52 -0400)
- Show the count of bytes written on partial file upload.

Prior to this change the error message mistakenly showed the count of
bytes read, not written.

Bug: https://github.com/curl/curl/discussions/8637
Reported-by: Taras Kushnir
Closes https://github.com/curl/curl/pull/8649

lib/ftp.c

index c6efaedd3db382f3e8264b2db1237e92636cc09f..47df88b000e7ada3c3017b60845d79669643f3b6 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3381,7 +3381,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
        (ftp->transfer == PPTRANSFER_BODY)) {
       failf(data, "Uploaded unaligned file size (%" CURL_FORMAT_CURL_OFF_T
             " out of %" CURL_FORMAT_CURL_OFF_T " bytes)",
-            data->req.bytecount, data->state.infilesize);
+            data->req.writebytecount, data->state.infilesize);
       result = CURLE_PARTIAL_FILE;
     }
   }