commit 890223df6dda46ee8d18df74d79115efb81728d6
parent dc7bd3224ed299c3d7c83faca877e8d5d8fb1051
Author: hhvn <dev@hhvn.uk>
Date: Sat, 13 Nov 2021 10:41:03 +0000
commands.c: don't segfault on missing arg to /select
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands.c b/commands.c
@@ -242,12 +242,12 @@ command_select(struct Server *server, char *str) {
if (str)
ui_error("ignoring trailing arguments: '%s'", str);
- } else {
+ } else if (str) {
buf = atoi(str);
if (!buf)
ui_error("invalid buffer index: '%s'", str);
ui_buflist_select(buf);
- }
+ } else ui_error("/select requires argument", NULL);
}
void