From 2756ca4347cbda05b16954cd7f445c216b935e76 Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Tue, 16 Sep 2014 20:56:57 +0200 Subject: use REALLOC_ARRAY for changing the allocation size of arrays Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- walker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'walker.c') diff --git a/walker.c b/walker.c index f8d370913a..18a67d33cb 100644 --- a/walker.c +++ b/walker.c @@ -228,8 +228,8 @@ int walker_targets_stdin(char ***target, const char ***write_ref) if (targets >= targets_alloc) { targets_alloc = targets_alloc ? targets_alloc * 2 : 64; - *target = xrealloc(*target, targets_alloc * sizeof(**target)); - *write_ref = xrealloc(*write_ref, targets_alloc * sizeof(**write_ref)); + REALLOC_ARRAY(*target, targets_alloc); + REALLOC_ARRAY(*write_ref, targets_alloc); } (*target)[targets] = xstrdup(tg_one); (*write_ref)[targets] = rf_one ? xstrdup(rf_one) : NULL; -- cgit v1.2.3