fetch_populated_submodules(): document dynamic allocation
... while fixing a miscounting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Dec 9, 2010 at 23:42 UTC
1c1f3537c0283c92abbca9155813ed62b05cb481
1 file changed
+2
-1
submodule.c
+2
-1
@@ -264,7 +264,8 @@ int fetch_populated_submodules(int num_options, const char **options,
264
if (read_cache() < 0)
265
die("index file corrupt");
266
267
- argv = xcalloc(num_options + 5, sizeof(const char *));
267
+ /* 4: "fetch" (options) "--submodule-prefix" prefix NULL */
268
+ argv = xcalloc(num_options + 4, sizeof(const char *));
269
argv[argc++] = "fetch";
270
for (i = 0; i < num_options; i++)
271
argv[argc++] = options[i];