supervise-daemon: fix off-by-one error

This commit is contained in:
William Hubbs 2018-03-14 20:05:45 -05:00
parent 92e6bdee12
commit 5346fbf2c9

View File

@ -232,8 +232,8 @@ static char *make_cmdline(char **argv)
for (c = argv; c && *c; c++) for (c = argv; c && *c; c++)
len += (strlen(*c) + 1); len += (strlen(*c) + 1);
cmdline = xmalloc(len); cmdline = xmalloc(len+1);
memset(cmdline, 0, len); memset(cmdline, 0, len+1);
for (c = argv; c && *c; c++) { for (c = argv; c && *c; c++) {
strcat(cmdline, *c); strcat(cmdline, *c);
strcat(cmdline, " "); strcat(cmdline, " ");