From f6661379c68b541115efe25285965bbd4eb32d25 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Sat, 3 Jul 2004 04:25:48 +0000 Subject: Imported from pacman-2.8.tar.gz --- libftp/ftplib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libftp/ftplib.c') diff --git a/libftp/ftplib.c b/libftp/ftplib.c index 1e299b5b..b69744eb 100644 --- a/libftp/ftplib.c +++ b/libftp/ftplib.c @@ -1139,9 +1139,9 @@ static int FtpXfer(const char *localfile, const char *path, else { while ((l = FtpRead(dbuf, FTPLIB_BUFSIZ, nData)) > 0) - if (fwrite(dbuf, 1, l, local) <= 0) + if (fwrite(dbuf, 1, l, local) < l) { - perror("localfile write"); + perror("\nlocalfile write"); rv = 0; break; } @@ -1486,9 +1486,9 @@ static int HttpXfer(const char *localfile, const char *path, int *size, { nControl->dir = FTPLIB_READ; while ((l = FtpRead(dbuf, FTPLIB_BUFSIZ, nControl)) > 0) { - if (fwrite(dbuf, 1, l, local) <= 0) + if (fwrite(dbuf, 1, l, local) < l) { - perror("localfile write"); + perror("\nlocalfile write"); rv = 0; break; } -- cgit v1.2.3-24-g4f1b