mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[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:
parent
667d494978
commit
562ab4ae8a
@ -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.
|
||||
|
@ -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; \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user