From: hniksic Date: Tue, 19 Feb 2002 05:32:59 +0000 (-0800) Subject: [svn] (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when calling X-Git-Tag: v1.13~1834 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=562ab4ae8af558352a00f1ad7ed55cae1cf2b26a [svn] (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when calling xmalloc and memcpy. Submitted by Andreas Damm in . --- diff --git a/src/ChangeLog b/src/ChangeLog index 992207de..e22b1bbc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-02-19 Andreas Damm + + * wget.h (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when + calling xmalloc and memcpy. + 2002-02-19 Hrvoje Niksic * host.h: Include Unix-specific includes #ifndef WINDOWS. diff --git a/src/wget.h b/src/wget.h index fe57639f..e9191387 100644 --- a/src/wget.h +++ b/src/wget.h @@ -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; \ } \