summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-10 07:42:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-10 07:42:05 (GMT)
commit1c1f3537c0283c92abbca9155813ed62b05cb481 (patch)
treebd57d9450abda36800472e514e133fb45b244bf8 /submodule.c
parentc1a3c3640deb8bd6929026a55b18feb1dda74e77 (diff)
downloadgit-1c1f3537c0283c92abbca9155813ed62b05cb481.zip
git-1c1f3537c0283c92abbca9155813ed62b05cb481.tar.gz
git-1c1f3537c0283c92abbca9155813ed62b05cb481.tar.bz2
fetch_populated_submodules(): document dynamic allocation
... while fixing a miscounting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 4e62900..6f1c107 100644
--- a/submodule.c
+++ b/submodule.c
@@ -264,7 +264,8 @@ int fetch_populated_submodules(int num_options, const char **options,
if (read_cache() < 0)
die("index file corrupt");
- argv = xcalloc(num_options + 5, sizeof(const char *));
+ /* 4: "fetch" (options) "--submodule-prefix" prefix NULL */
+ argv = xcalloc(num_options + 4, sizeof(const char *));
argv[argc++] = "fetch";
for (i = 0; i < num_options; i++)
argv[argc++] = options[i];