initctl: Fix 'cond dump/set/clear' commands, only show worked
This patch fixes an invalid use of strpbrk() causing all cond
sub-commands, except initctl cond show, to fail.
@@ -337,15 +337,14 @@ static int do_cond(char *cmd)
{ NULL, NULL }
};
- arg = strpbrk(cmd, " ");
- if (arg) {
- *arg = 0;
+ arg = strpbrk(cmd, " \0");
+ if (arg)
+ *arg++ = 0;
for (c = 0; command[c].cmd; c++) {
if (!strcmp(command[c].cmd, cmd))
return command[c].cb(arg);
}
- }
return do_cond_show(NULL);
}
