From 52847a951802fda7a3ce36cdac77c34914b0ccca Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 15 Jan 2017 22:00:56 +0000 Subject: It is silly for cmd_list_parse to return an integer error when it could just return NULL. --- cmd-set-hook.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd-set-hook.c') 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); -- cgit