lineedit: in !EDITING config, return -1 on fgets error

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2012-09-27 16:03:49 +02:00
parent 9371043698
commit b2320370be

View File

@ -2729,7 +2729,8 @@ int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize)
{ {
fputs(prompt, stdout); fputs(prompt, stdout);
fflush_all(); fflush_all();
fgets(command, maxsize, stdin); if (!fgets(command, maxsize, stdin))
return -1;
return strlen(command); return strlen(command);
} }