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>
This commit is contained in:
René Scharfe
2014-09-16 20:56:57 +02:00
committed by Junio C Hamano
parent 3ac22f82ed
commit 2756ca4347
26 changed files with 40 additions and 70 deletions

View File

@ -1440,7 +1440,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
continue;
nr++;
list = xrealloc(list, nr * sizeof(list[0]));
REALLOC_ARRAY(list, nr);
list[nr - 1] = commit;
}
if (nr == 0)