Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-16 22:56:57 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-18 20:13:42 +0400
commit2756ca4347cbda05b16954cd7f445c216b935e76 (patch)
tree70afb2d44557fd05bbc0707c190c6026ab6135fd /builtin/mv.c
parent3ac22f82edec108986b2627fcd6f2a8039617a23 (diff)
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>
Diffstat (limited to 'builtin/mv.c')
-rw-r--r--builtin/mv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/mv.c b/builtin/mv.c
index bf784cb9436..8883baa903e 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -184,10 +184,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
modes[i] = WORKING_DIRECTORY;
n = argc + last - first;
- source = xrealloc(source, n * sizeof(char *));
- destination = xrealloc(destination, n * sizeof(char *));
- modes = xrealloc(modes, n * sizeof(enum update_mode));
- submodule_gitfile = xrealloc(submodule_gitfile, n * sizeof(char *));
+ REALLOC_ARRAY(source, n);
+ REALLOC_ARRAY(destination, n);
+ REALLOC_ARRAY(modes, n);
+ REALLOC_ARRAY(submodule_gitfile, n);
dst = add_slash(dst);
dst_len = strlen(dst);