lineedit: in !EDITING config, return -1 on fgets error
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 14:03:49 +0000 (16:03 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 14:03:49 +0000 (16:03 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/lineedit.c

index 92bea85..dbe6164 100644 (file)
@@ -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);
 }