diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-09-27 16:03:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-09-27 16:03:49 +0200 |
commit | b2320370be14811459718b9fe418efed75ea3615 (patch) | |
tree | 8f53f5e8f5d4176ffe9932fd502be056f4ea56b2 /libbb/lineedit.c | |
parent | 9371043698933452bb69566f279a6e40af961c8c (diff) | |
download | busybox-w32-b2320370be14811459718b9fe418efed75ea3615.tar.gz busybox-w32-b2320370be14811459718b9fe418efed75ea3615.tar.bz2 busybox-w32-b2320370be14811459718b9fe418efed75ea3615.zip |
lineedit: in !EDITING config, return -1 on fgets error
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
2729 | { | 2729 | { |
2730 | fputs(prompt, stdout); | 2730 | fputs(prompt, stdout); |
2731 | fflush_all(); | 2731 | fflush_all(); |
2732 | fgets(command, maxsize, stdin); | 2732 | if (!fgets(command, maxsize, stdin)) |
2733 | return -1; | ||
2733 | return strlen(command); | 2734 | return strlen(command); |
2734 | } | 2735 | } |
2735 | 2736 | ||