diff options
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -222,7 +222,7 @@ cmd_stringify_argv(int argc, char **argv) for (i = 0; i < argc; i++) { len += strlen(argv[i]) + 1; - buf = xrealloc(buf, 1, len); + buf = xrealloc(buf, len); if (i == 0) *buf = '\0'; @@ -1302,11 +1302,11 @@ cmd_template_replace(const char *template, const char *s, int idx) ptr++; len += strlen(s); - buf = xrealloc(buf, 1, len + 1); + buf = xrealloc(buf, len + 1); strlcat(buf, s, len + 1); continue; } - buf = xrealloc(buf, 1, len + 2); + buf = xrealloc(buf, len + 2); buf[len++] = ch; buf[len] = '\0'; } |