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 --- string-list.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'string-list.c') diff --git a/string-list.c b/string-list.c index db38b62b4..c5aa0765e 100644 --- a/string-list.c +++ b/string-list.c @@ -43,8 +43,7 @@ static int add_entry(int insert_at, struct string_list *list, const char *string if (list->nr + 1 >= list->alloc) { list->alloc += 32; - list->items = xrealloc(list->items, list->alloc - * sizeof(struct string_list_item)); + REALLOC_ARRAY(list->items, list->alloc); } if (index < list->nr) memmove(list->items + index + 1, list->items + index, -- cgit v1.2.1