commit e08e8bd8ddf0691b932f2b0778ef1dbc4feb7bb3
parent b8c1cc0140e91f44de035ecc37f470edbaf9bc5c
Author: hhvn <dev@hhvn.uk>
Date: Fri, 18 Jun 2021 22:13:08 +0100
sfeed_curses.c: lineeditor: return explicit NULL on escape
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -952,7 +952,8 @@ lineeditor(void)
escape = 0;
write(1, &ch, 1);
} else if (escape) {
- input[0] = '\0';
+ free(input);
+ return NULL;
break;
} else if (ch == EOF || ch == '\r' || ch == '\n') {
input[nchars] = '\0';