From 562ab4ae8af558352a00f1ad7ed55cae1cf2b26a Mon Sep 17 00:00:00 2001 From: hniksic Date: Mon, 18 Feb 2002 21:32:59 -0800 Subject: [PATCH] [svn] (DO_REALLOC_FROM_ALLOCA): Multiply with sizeof(type) when calling xmalloc and memcpy. Submitted by Andreas Damm in . --- src/ChangeLog | 5 +++++ src/wget.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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; \ } \ -- 2.39.2