summaryrefslogtreecommitdiffstats
path: root/cmd-set-hook.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-15 22:00:56 +0000
committernicm <nicm>2017-01-15 22:00:56 +0000
commit52847a951802fda7a3ce36cdac77c34914b0ccca (patch)
tree7e5ad465e719d32f2a7d9a7c3469dec6d12448a4 /cmd-set-hook.c
parent30548461439f02ed8327f96748035685a1a26ace (diff)
It is silly for cmd_list_parse to return an integer error when it could
just return NULL.
Diffstat (limited to 'cmd-set-hook.c')
-rw-r--r--cmd-set-hook.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd-set-hook.c b/cmd-set-hook.c
index 2685fc8d..fff7ccd7 100644
--- a/cmd-set-hook.c
+++ b/cmd-set-hook.c
@@ -115,7 +115,8 @@ cmd_set_hook_exec(struct cmd *self, struct cmdq_item *item)
cmdq_error(item, "no command to set hook: %s", name);
return (CMD_RETURN_ERROR);
}
- if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) {
+ cmdlist = cmd_string_parse(cmd, NULL, 0, &cause);
+ if (cmdlist == NULL) {
if (cause != NULL) {
cmdq_error(item, "%s", cause);
free(cause);