1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Convert a static local buffer to be allocated dinamically.

This commit is contained in:
Giuseppe Scrivano 2010-12-01 12:47:30 +01:00
parent 20a64d03d8
commit 334a8e9027
2 changed files with 12 additions and 6 deletions

View File

@ -1,8 +1,12 @@
2010-12-01 Giuseppe Scrivano <gscrivano@gnu.org>
* retr.c (fd_read_body): Dinamically allocate `dlbuf'.
2010-11-27 Reza Snowdon <vivi@mage.me.uk> 2010-11-27 Reza Snowdon <vivi@mage.me.uk>
* init.c (initialize): If 'ok' is not zero; exit, as * init.c (initialize): If 'ok' is not zero; exit, as this
this indicates there was a problem parsing 'SYSTEM_WGETRC'. indicates there was a problem parsing 'SYSTEM_WGETRC'.
Fixes bug #20370 Fixes bug #20370.
2010-11-22 Giuseppe Scrivano <gscrivano@gnu.org> 2010-11-22 Giuseppe Scrivano <gscrivano@gnu.org>

View File

@ -209,8 +209,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
{ {
int ret = 0; int ret = 0;
static char dlbuf[16384]; int dlbufsize = BUFSIZ;
int dlbufsize = sizeof (dlbuf); char *dlbuf = xmalloc (BUFSIZ);
struct ptimer *timer = NULL; struct ptimer *timer = NULL;
double last_successful_read_tm = 0; double last_successful_read_tm = 0;
@ -388,6 +388,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
if (qtywritten) if (qtywritten)
*qtywritten += sum_written; *qtywritten += sum_written;
free (dlbuf);
return ret; return ret;
} }