summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2005-01-15 17:34:55 +0000
committersabetts <sabetts>2005-01-15 17:34:55 +0000
commit6e0af3d35f55833df7a9f31cd4a1888667a9b633 (patch)
tree52460814dc38cb755223f70a2a9cfa195da40026 /src/actions.c
parent9376a79ac58a8953da9a3c7bed929165c7703e5c (diff)
downloadratpoison-6e0af3d35f55833df7a9f31cd4a1888667a9b633.zip
(command): check list_size of head when checking for too many
arguments. (cmd_set): raise error if set command was passed too many arguments.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c
index 8d408f9..0d633b0 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -2306,7 +2306,7 @@ command (int interactive, char *data)
result = cmdret_new ("not enough arguments.", RET_FAILURE);
goto free_lists;
}
- else if (list_size (&args) > uc->num_args)
+ else if (list_size (&head) > uc->num_args)
{
result = cmdret_new ("too many arguments.", RET_FAILURE);
goto free_lists;
@@ -4727,6 +4727,11 @@ cmd_set (int interactive, struct cmdarg **args)
result = cmdret_new ("not enough arguments.", RET_FAILURE);
goto failed;
}
+ else if (list_size (&head) > ARG(0,variable)->nargs)
+ {
+ result = cmdret_new ("too many arguments.", RET_FAILURE);
+ goto failed;
+ }
cmdargs = arg_array (&arglist);
result = ARG(0,variable)->set_fn (cmdargs);