]> granicus.if.org Git - curl/commitdiff
ftp_parselist: fix compiler warning
authorDaniel Stenberg <daniel@haxx.se>
Sat, 18 Dec 2010 23:15:12 +0000 (00:15 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 18 Dec 2010 23:15:12 +0000 (00:15 +0100)
Doing curlx_strtoofft() on the size just to figure out the end of it
causes a compiler warning since the result wasn't used, but is also a
bit of a waste.

lib/ftplistparser.c

index c59ea7e162274a3395016d2f0b845781a2eb722a..6f7475337c41795886530b5f8374bfa86da60bbd 100644 (file)
@@ -447,9 +447,10 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
           else if(c == '\n') {
             finfo->b_data[parser->item_length - 1] = 0;
             if(strncmp("total ", finfo->b_data, 6) == 0) {
-              char *endptr = NULL;
+              char *endptr = finfo->b_data+6;
               /* here we can deal with directory size */
-              curlx_strtoofft(finfo->b_data+6, &endptr, 10);
+              while(ISSPACE(*endptr))
+                endptr++;
               if(*endptr != 0) {
                 PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
                 return bufflen;