diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c index 07aeff9..a7466e0 100644 --- a/src/actions.c +++ b/src/actions.c @@ -171,7 +171,7 @@ add_command (char *name, cmdret * (*fn)(int, struct cmdarg **), int nargs, int i cmd->num_args = nargs; cmd->ni_required_args = ni_nrequired; cmd->i_required_args = i_nrequired; - cmd->args = xmalloc(sizeof(struct argspec) * nargs); + cmd->args = nargs ? xmalloc (nargs * sizeof (struct argspec)) : NULL; /* Fill cmd->args */ va_start(va, ni_nrequired); |