aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-05-04 10:43:34 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-05-04 10:43:34 +0000
commit5ec58285c3990ebab9900295f1a1d32824338719 (patch)
tree2ca89594931272969886e88e6055f273b26901b1
parentff5309ac99eb8ee0fc5ed180a3836779534fd2f3 (diff)
downloadbusybox-w32-5ec58285c3990ebab9900295f1a1d32824338719.tar.gz
busybox-w32-5ec58285c3990ebab9900295f1a1d32824338719.tar.bz2
busybox-w32-5ec58285c3990ebab9900295f1a1d32824338719.zip
Fix size command, safe_strtoul gives and error if the \r is left in, the
RFC spec says the \r should be there. This fix is the same as a recent wget fix
-rw-r--r--networking/ftpgetput.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 2ef0b2c44..f6bd82bc8 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -70,11 +70,16 @@ static int ftpcmd(const char *s1, const char *s2, FILE *stream, char *buf)
70 fprintf(stream, "%s\n", s1); 70 fprintf(stream, "%s\n", s1);
71 } 71 }
72 } 72 }
73
74 do { 73 do {
74 char *buf_ptr;
75
75 if (fgets(buf, 510, stream) == NULL) { 76 if (fgets(buf, 510, stream) == NULL) {
76 bb_perror_msg_and_die("fgets()"); 77 bb_perror_msg_and_die("fgets()");
77 } 78 }
79 buf_ptr = strstr(buf, "\r\n");
80 if (buf_ptr) {
81 *buf_ptr = '\0';
82 }
78 } while (! isdigit(buf[0]) || buf[3] != ' '); 83 } while (! isdigit(buf[0]) || buf[3] != ' ');
79 84
80 return atoi(buf); 85 return atoi(buf);