]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Tim Kosse points out that xfer_upload_gotpkt can return a negative
authorSimon Tatham <anakin@pobox.com>
Tue, 16 Sep 2008 12:48:38 +0000 (12:48 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 16 Sep 2008 12:48:38 +0000 (12:48 +0000)
value on error, so the check at the call site shouldn't test for
exactly zero.

[originally from svn r8183]

psftp.c

diff --git a/psftp.c b/psftp.c
index cb5add3f930d470550ee7e8c8a70ac975b9c3513..63446d4d694fe5294c5863ea1784155ba50611eb 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -707,7 +707,7 @@ int sftp_put_file(char *fname, char *outfname, int recurse, int restart)
        if (!xfer_done(xfer)) {
            pktin = sftp_recv();
            ret = xfer_upload_gotpkt(xfer, pktin);
-           if (!ret) {
+           if (ret <= 0 && !err) {
                printf("error while writing: %s\n", fxp_error());
                err = 1;
            }