From 2a0cf16c3373af9aabb05a447e4ebe1ae3f07149 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 16 Sep 2008 12:48:38 +0000 Subject: [PATCH] Tim Kosse points out that xfer_upload_gotpkt can return a negative value on error, so the check at the call site shouldn't test for exactly zero. [originally from svn r8183] --- psftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psftp.c b/psftp.c index cb5add3f..63446d4d 100644 --- 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; }