summaryrefslogtreecommitdiffstats
path: root/cmd-string.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-string.c')
-rw-r--r--cmd-string.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd-string.c b/cmd-string.c
index e1e7e81f..111c5990 100644
--- a/cmd-string.c
+++ b/cmd-string.c
@@ -131,7 +131,8 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
if (argc == 0)
goto out;
- *cmd = cmd_parse(argc, argv, cause);
+ if ((*cmd = cmd_parse(argc, argv, cause)) == NULL)
+ goto error;
rval = 0;
goto out;
default:
@@ -145,7 +146,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
}
error:
- xasprintf(cause, "bad command: %s", s);
+ xasprintf(cause, "invalid or unknown command: %s", s);
out:
if (buf != NULL)