xmalloc and memcpy.
Submitted by Andreas Damm in
<Pine.LNX.4.33.
0202011632280.1281-200000@gate.rad-ab.u-net.com>.
+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.
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; \
} \