Tim Kosse points out that xfer_upload_gotpkt can return a negative
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 16 Sep 2008 12:48:38 +0000 (12:48 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
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.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8183 cda61777-01e9-0310-a592-d414129be87e

psftp.c

diff --git a/psftp.c b/psftp.c
index cb5add3..63446d4 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;
            }