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 92bea856e4bd9fcb70222726f2ab8d673ae76a2d..dbe616466d09dffe4797ab22123b8fe536d3e60f 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);
 }