summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-12-01 09:04:39 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-12-01 09:04:39 -0800
commit9da394878174b1197844f90a2f085443e72203cb (patch)
tree9b74abc20dc3d8da4764ad290a56583ccc4da3c3 /compat
parentMerge branch 'rs/parse-options-dup-null-fix' (diff)
parentmingw: use COPY_ARRAY for copying array (diff)
downloadtgif-9da394878174b1197844f90a2f085443e72203cb.tar.xz
Merge branch 'rs/use-copy-array-in-mingw-shell-command-preparation'
Code cleanup. * rs/use-copy-array-in-mingw-shell-command-preparation: mingw: use COPY_ARRAY for copying array
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index fe609239dd..2f4654c968 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1566,7 +1566,7 @@ static int try_shell_exec(const char *cmd, char *const *argv)
while (argv[argc]) argc++;
ALLOC_ARRAY(argv2, argc + 1);
argv2[0] = (char *)cmd; /* full path to the script file */
- memcpy(&argv2[1], &argv[1], sizeof(*argv) * argc);
+ COPY_ARRAY(&argv2[1], &argv[1], argc);
exec_id = trace2_exec(prog, argv2);
pid = mingw_spawnv(prog, argv2, 1);
if (pid >= 0) {