summaryrefslogtreecommitdiff
path: root/snarf-ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'snarf-ftp.c')
-rw-r--r--snarf-ftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/snarf-ftp.c b/snarf-ftp.c
index 23e35db..1a26aa1 100644
--- a/snarf-ftp.c
+++ b/snarf-ftp.c
@@ -107,7 +107,7 @@ static char *get_line(UrlResource *rsrc, int control)
char *end;
char buf[SNARF_BUFSIZE+1];
- while ((bytes_read = read(control, buf, SNARF_BUFSIZE))) {
+ while ((bytes_read = read(control, buf, SNARF_BUFSIZE)) > 0) {
if (buf[0] == '4' || buf[0] == '5') return NULL;
@@ -118,7 +118,7 @@ static char *get_line(UrlResource *rsrc, int control)
if (buf[bytes_read - 2] == '\r') buf[bytes_read - 2] = '\0';
- ui_expert(rsrc->op, buf);
+ ui_expert(rsrc->op, "%s", buf);
if (isdigit(buf[0]) && buf[3] == ' ') {
return strdup(buf);
@@ -297,7 +297,7 @@ int ftp_transfer(UrlResource *rsrc)
rsrc->proxy = get_proxy("FTP_PROXY");
- if (rsrc->proxy) {
+ if (rsrc->proxy && (rsrc->proxy[0] != '\0')) {
return http_transfer(rsrc);
}