Merge branch 'rs/realloc-array'

Code cleanup.

* rs/realloc-array:
  use REALLOC_ARRAY for changing the allocation size of arrays
  add macro REALLOC_ARRAY
This commit is contained in:
Junio C Hamano
2014-09-26 14:39:45 -07:00
28 changed files with 45 additions and 70 deletions

3
git.c
View File

@ -282,8 +282,7 @@ static int handle_alias(int *argcp, const char ***argv)
"trace: alias expansion: %s =>",
alias_command);
new_argv = xrealloc(new_argv, sizeof(char *) *
(count + *argcp));
REALLOC_ARRAY(new_argv, count + *argcp);
/* insert after command name */
memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);