summaryrefslogtreecommitdiffstats
path: root/cmd-confirm-before.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-confirm-before.c')
-rw-r--r--cmd-confirm-before.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c
index db799a4b..fd366b9b 100644
--- a/cmd-confirm-before.c
+++ b/cmd-confirm-before.c
@@ -107,7 +107,9 @@ cmd_confirm_before_callback(void *data, const char *s)
struct cmd_ctx ctx;
char *cause;
- if (s == NULL || tolower((u_char) s[0]) != 'y' || s[1] != '\0')
+ if (s == NULL || *s == '\0')
+ return (0);
+ if (tolower((u_char) s[0]) != 'y' || s[1] != '\0')
return (0);
if (cmd_string_parse(cdata->cmd, &cmdlist, &cause) != 0) {