]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix sftp_get_file returning success on failed transfers.
authorTim Kosse <tim.kosse@filezilla-project.org>
Wed, 28 Dec 2016 13:59:49 +0000 (14:59 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 29 Dec 2016 11:18:03 +0000 (11:18 +0000)
Due to the return variable 'ret' being shadowed in the transfer loop, errors
in the transfer loop did not affect the final return value of sftp_get_file.
This particularly affects psftp's batch mode (without passing the -be
command-line argument), which would errorneously continue. The solution is
to simply remove the shadowing declaration.

psftp.c

diff --git a/psftp.c b/psftp.c
index a718b794dc779ee87b36958891e0188f29e816ee..9c042cd22faae98058fb2fc873c665529428a351 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -433,7 +433,7 @@ int sftp_get_file(char *fname, char *outfname, int recurse, int restart)
     xfer = xfer_download_init(fh, offset);
     while (!xfer_done(xfer)) {
        void *vbuf;
-       int ret, len;
+       int len;
        int wpos, wlen;
 
        xfer_download_queue(xfer);