summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authornicm <nicm>2014-10-08 17:35:58 +0000
committernicm <nicm>2014-10-08 17:35:58 +0000
commita27ba6e38006c12c48de88600b8cff9f6aabfed7 (patch)
treefc8ecf1c1b965f70b95d0a3e472cd0b1a2e1d2c9 /cmd.c
parent77efcf8bdd14cd19dc445cf6e44bba7af414939c (diff)
Add xreallocarray and remove nmemb argument from xrealloc.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd.c b/cmd.c
index 82410323..66ac58b8 100644
--- a/cmd.c
+++ b/cmd.c
@@ -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';
}