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-11-27 Reza Snowdon <vivi@mage.me.uk>
2010-12-01 Giuseppe Scrivano <gscrivano@gnu.org>
* 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 <vivi@mage.me.uk>
* 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 <gscrivano@gnu.org>

View File

@ -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;
}