From: Giuseppe Scrivano Date: Wed, 1 Dec 2010 11:47:30 +0000 (+0100) Subject: Convert a static local buffer to be allocated dinamically. X-Git-Tag: v1.13~78 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=334a8e902746f8fc30e0fad3928276a0c9235611 Convert a static local buffer to be allocated dinamically. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5e5843f2..eacf9a4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,12 @@ -2010-11-27 Reza Snowdon +2010-12-01 Giuseppe Scrivano - * init.c (initialize): If 'ok' is not zero; exit, as - this indicates there was a problem parsing 'SYSTEM_WGETRC'. - Fixes bug #20370 + * retr.c (fd_read_body): Dinamically allocate `dlbuf'. + +2010-11-27 Reza Snowdon + + * init.c (initialize): If 'ok' is not zero; exit, as this + indicates there was a problem parsing 'SYSTEM_WGETRC'. + Fixes bug #20370. 2010-11-22 Giuseppe Scrivano diff --git a/src/retr.c b/src/retr.c index 83f47bee..5dc3cc8d 100644 --- a/src/retr.c +++ b/src/retr.c @@ -209,8 +209,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos, { int ret = 0; - static char dlbuf[16384]; - int dlbufsize = sizeof (dlbuf); + int dlbufsize = BUFSIZ; + char *dlbuf = xmalloc (BUFSIZ); struct ptimer *timer = NULL; double last_successful_read_tm = 0; @@ -388,6 +388,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos, if (qtywritten) *qtywritten += sum_written; + free (dlbuf); + return ret; }