aboutsummaryrefslogtreecommitdiffstats
path: root/ipc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-01-21 23:23:58 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2006-01-21 23:23:58 +0100
commitf1d38f20f760376f43b90a105486cf3ff2fbf2c4 (patch)
treed0bab65e5b810639d298f29be9afc20542856af0 /ipc.c
parentf73b9697f9be18e04ec7458634520f9dd2e2432f (diff)
Fixed counting of arguments in i[rp]c_exec(), made them a bit too simple.
Diffstat (limited to 'ipc.c')
-rw-r--r--ipc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ipc.c b/ipc.c
index 8d44e4eb..3528988f 100644
--- a/ipc.c
+++ b/ipc.c
@@ -154,7 +154,7 @@ static const command_t ipc_child_commands[] = {
static void ipc_command_exec( void *data, char **cmd, const command_t *commands )
{
- int i;
+ int i, j;
if( !cmd[0] )
return;
@@ -162,12 +162,18 @@ static void ipc_command_exec( void *data, char **cmd, const command_t *commands
for( i = 0; commands[i].command; i ++ )
if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 )
{
+ /* There is no typo in this line: */
+ for( j = 1; cmd[j]; j ++ ); j --;
+
+ if( j < commands[i].required_parameters )
+ break;
+
if( commands[i].flags & IPC_CMD_TO_CHILDREN )
ipc_to_children( cmd );
else
commands[i].execute( data, cmd );
- return;
+ break;
}
}