summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alias.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/alias.c b/alias.c
index ccb1108c94..4f4d0141cd 100644
--- a/alias.c
+++ b/alias.c
@@ -38,10 +38,7 @@ int split_cmdline(char *cmdline, const char ***argv)
while (cmdline[++src]
&& isspace(cmdline[src]))
; /* skip */
- if (count >= size) {
- size += 16;
- *argv = xrealloc(*argv, sizeof(char*) * size);
- }
+ ALLOC_GROW(*argv, count+1, size);
(*argv)[count++] = cmdline + dst;
} else if (!quoted && (c == '\'' || c == '"')) {
quoted = c;
@@ -72,6 +69,9 @@ int split_cmdline(char *cmdline, const char ***argv)
return error("unclosed quote");
}
+ ALLOC_GROW(*argv, count+1, size);
+ (*argv)[count] = NULL;
+
return count;
}