From 069f5925af8bf70a99eec7f4baf5772707e62def Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 21 Aug 2021 20:46:43 +0000 Subject: Preserve argument type in command and convert to string on demand. --- cmd-parse.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd-parse.y') diff --git a/cmd-parse.y b/cmd-parse.y index 57d0e84e..86917941 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -804,7 +804,8 @@ cmd_parse_build_command(struct cmd_parse_command *cmd, return (cmdlist); TAILQ_FOREACH(arg, &cmd->arguments, entry) { - values = xreallocarray(values, count + 1, sizeof *values); + values = xrecallocarray(values, count, count + 1, + sizeof *values); switch (arg->type) { case CMD_PARSE_STRING: values[count].type = ARGS_STRING; -- cgit