From b2320370be14811459718b9fe418efed75ea3615 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 27 Sep 2012 16:03:49 +0200 Subject: [PATCH] lineedit: in !EDITING config, return -1 on fgets error Signed-off-by: Denys Vlasenko --- libbb/lineedit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 92bea856e..dbe616466 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -2729,7 +2729,8 @@ int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize) { fputs(prompt, stdout); fflush_all(); - fgets(command, maxsize, stdin); + if (!fgets(command, maxsize, stdin)) + return -1; return strlen(command); } -- 2.25.1