summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-09-26 14:39:45 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-09-26 14:39:45 -0700
commit1c2ea2cdc0e8c4e5af942c51b234c5af527944f6 (patch)
tree26554b52f6dcd97e2194c4b0c32106b6a2b72f92 /builtin/log.c
parentMerge branch 'jk/close-stderr-of-credential-cache-deamon' (diff)
parentuse REALLOC_ARRAY for changing the allocation size of arrays (diff)
downloadtgif-1c2ea2cdc0e8c4e5af942c51b234c5af527944f6.tar.xz
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 'builtin/log.c')
-rw-r--r--builtin/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 4ea71fee68..2fb34c7de9 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -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)