diff options
| author | Junio C Hamano <gitster@pobox.com> | 2014-09-26 14:39:45 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2014-09-26 14:39:45 -0700 |
| commit | 1c2ea2cdc0e8c4e5af942c51b234c5af527944f6 (patch) | |
| tree | 26554b52f6dcd97e2194c4b0c32106b6a2b72f92 /walker.c | |
| parent | b33000878a88b52816b97aeb88ba3677902ad277 (diff) | |
| parent | 2756ca4347cbda05b16954cd7f445c216b935e76 (diff) | |
| download | git-1c2ea2cdc0e8c4e5af942c51b234c5af527944f6.tar.gz | |
Merge branch 'rs/realloc-array'
Code cleanup.
* rs/realloc-array:
use REALLOC_ARRAY for changing the allocation size of arrays
add macro REALLOC_ARRAY
Diffstat (limited to 'walker.c')
| -rw-r--r-- | walker.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -228,8 +228,8 @@ int walker_targets_stdin(char ***target, const char ***write_ref) if (targets >= targets_alloc) { targets_alloc = targets_alloc ? targets_alloc * 2 : 64; - *target = xrealloc(*target, targets_alloc * sizeof(**target)); - *write_ref = xrealloc(*write_ref, targets_alloc * sizeof(**write_ref)); + REALLOC_ARRAY(*target, targets_alloc); + REALLOC_ARRAY(*write_ref, targets_alloc); } (*target)[targets] = xstrdup(tg_one); (*write_ref)[targets] = rf_one ? xstrdup(rf_one) : NULL; |
