aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 8e636bd39..8028f1230 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -128,6 +128,7 @@ static void strip_ipv6_scope_id(char *host)
128 overlapping_strcpy(scope, cp); 128 overlapping_strcpy(scope, cp);
129} 129}
130 130
131#if 0 /* were needed when we used signal-driven progress bar */
131/* Read NMEMB bytes into PTR from STREAM. Returns the number of bytes read, 132/* Read NMEMB bytes into PTR from STREAM. Returns the number of bytes read,
132 * and a short count if an eof or non-interrupt error is encountered. */ 133 * and a short count if an eof or non-interrupt error is encountered. */
133static size_t safe_fread(void *ptr, size_t nmemb, FILE *stream) 134static size_t safe_fread(void *ptr, size_t nmemb, FILE *stream)
@@ -160,6 +161,7 @@ static char *safe_fgets(char *s, int size, FILE *stream)
160 161
161 return ret; 162 return ret;
162} 163}
164#endif
163 165
164#if ENABLE_FEATURE_WGET_AUTHENTICATION 166#if ENABLE_FEATURE_WGET_AUTHENTICATION
165/* Base64-encode character string. */ 167/* Base64-encode character string. */
@@ -495,7 +497,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
495 progress_meter(PROGRESS_BUMP); 497 progress_meter(PROGRESS_BUMP);
496 } 498 }
497#endif 499#endif
498 n = safe_fread(G.wget_buf, rdsz, dfp); 500 n = fread(G.wget_buf, 1, rdsz, dfp);
499 if (n <= 0) { 501 if (n <= 0) {
500 if (ferror(dfp)) { 502 if (ferror(dfp)) {
501 /* perror will not work: ferror doesn't set errno */ 503 /* perror will not work: ferror doesn't set errno */
@@ -515,9 +517,9 @@ static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
515 if (!G.chunked) 517 if (!G.chunked)
516 break; 518 break;
517 519
518 safe_fgets(G.wget_buf, sizeof(G.wget_buf), dfp); /* This is a newline */ 520 fgets(G.wget_buf, sizeof(G.wget_buf), dfp); /* This is a newline */
519 get_clen: 521 get_clen:
520 safe_fgets(G.wget_buf, sizeof(G.wget_buf), dfp); 522 fgets(G.wget_buf, sizeof(G.wget_buf), dfp);
521 G.content_len = STRTOOFF(G.wget_buf, NULL, 16); 523 G.content_len = STRTOOFF(G.wget_buf, NULL, 16);
522 /* FIXME: error check? */ 524 /* FIXME: error check? */
523 if (G.content_len == 0) 525 if (G.content_len == 0)