[BusyBox-cvs] busybox/networking wget.c,1.72,1.73
Glenn McGrath
bug1 at busybox.net
Thu Apr 8 10:27:14 UTC 2004
Update of /var/cvs/busybox/networking
In directory nail:/tmp/cvs-serv14942/networking
Modified Files:
wget.c
Log Message:
Fix ftp resume
Terminate returned message at <CRLF> so strtoul returns without error
Index: wget.c
===================================================================
RCS file: /var/cvs/busybox/networking/wget.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- a/wget.c 27 Mar 2004 10:02:43 -0000 1.72
+++ b/wget.c 8 Apr 2004 10:27:11 -0000 1.73
@@ -660,8 +660,6 @@
static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf)
{
- char *p;
-
if (s1) {
if (!s2) s2="";
fprintf(fp, "%s%s\r\n", s1, s2);
@@ -669,9 +667,15 @@
}
do {
- p = fgets(buf, 510, fp);
- if (!p)
+ char *buf_ptr;
+
+ if (fgets(buf, 510, fp) == NULL) {
bb_perror_msg_and_die("fgets()");
+ }
+ buf_ptr = strstr(buf, "\r\n");
+ if (buf_ptr) {
+ *buf_ptr = '\0';
+ }
} while (! isdigit(buf[0]) || buf[3] != ' ');
return atoi(buf);
More information about the busybox-cvs
mailing list