summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/lineedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 92bea85..dbe6164 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);
}