[svn] (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when calling

xmalloc and memcpy.
Submitted by Andreas Damm in
<Pine.LNX.4.33.0202011632280.1281-200000@gate.rad-ab.u-net.com>.
This commit is contained in:
hniksic 2002-02-18 21:32:59 -08:00
parent 667d494978
commit 562ab4ae8a
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-02-19 Andreas Damm <andreas-sourceforge@radab.org>
* wget.h (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when
calling xmalloc and memcpy.
2002-02-19 Hrvoje Niksic <hniksic@arsdigita.com>
* host.h: Include Unix-specific includes #ifndef WINDOWS.

View File

@ -251,8 +251,9 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
else \
{ \
void *drfa_new_basevar = xmalloc (do_realloc_newsize); \
memcpy (drfa_new_basevar, basevar, (sizevar)); \
void *drfa_new_basevar = \
xmalloc (do_realloc_newsize * sizeof (type)); \
memcpy (drfa_new_basevar, basevar, (sizevar) * sizeof (type)); \
(basevar) = drfa_new_basevar; \
allocap = 0; \
} \