commit 3a60e19b5d96be737d66338c23f9a458f21c84f4
parent e08e8bd8ddf0691b932f2b0778ef1dbc4feb7bb3
Author: hhvn <dev@hhvn.uk>
Date: Sat, 3 Jul 2021 15:50:00 +0100
sfeed_curses.c: don't move forward one in search if input empty
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -956,6 +956,10 @@ lineeditor(void)
return NULL;
break;
} else if (ch == EOF || ch == '\r' || ch == '\n') {
+ if (nchars == 0) {
+ free(input);
+ return NULL;
+ }
input[nchars] = '\0';
break;
} else if (ch == '\b' || ch == 0x7f) {