add_arg macro was not null teriminating argument list. Null
termination was left as an responsibility for the caller. This is
error prone as this requirement is not clear.
Add null termination in the add_arg macro so that caller does not need
to care about it.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
args[argcnt] = argstr + idx; \
idx += sprintf(argstr + idx, fmt, ##arg); \
argcnt++; \
+ args[argcnt] = 0; \
argstr[++idx] = 0
int rrdtool_draw_image(struct rrd_image *image)
add_arg(args, argcnt, argstr, idx, "COMMENT: %s\\c", timestamp);
- args[argcnt] = 0;
-
pid = run(cmd, args);
harvest_zombies(pid);