Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-16 22:56:57 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-18 20:13:42 +0400
commit2756ca4347cbda05b16954cd7f445c216b935e76 (patch)
tree70afb2d44557fd05bbc0707c190c6026ab6135fd /sh-i18n--envsubst.c
parent3ac22f82edec108986b2627fcd6f2a8039617a23 (diff)
use REALLOC_ARRAY for changing the allocation size of arrays
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sh-i18n--envsubst.c')
-rw-r--r--sh-i18n--envsubst.c5
1 files changed, 1 insertions, 4 deletions
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. */