From 2756ca4347cbda05b16954cd7f445c216b935e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= 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 --- sh-i18n--envsubst.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sh-i18n--envsubst.c') diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c index 6dd03a974a..2842a22d7f 100644 --- a/sh-i18n--envsubst.c +++ b/sh-i18n--envsubst.c @@ -208,11 +208,8 @@ string_list_append (string_list_ty *slp, const char *s) /* Grow the list. */ if (slp->nitems >= slp->nitems_max) { - size_t nbytes; - slp->nitems_max = slp->nitems_max * 2 + 4; - nbytes = slp->nitems_max * sizeof (slp->item[0]); - slp->item = (const char **) xrealloc (slp->item, nbytes); + REALLOC_ARRAY(slp->item, slp->nitems_max); } /* Add the string to the end of the list. */ -- cgit v1.2.3