utils: test for EOF on error, not for \0.

This commit is contained in:
Enno Boland 2015-03-14 00:41:39 +01:00
parent 9dfed6fc0c
commit 1eeaa99438

View File

@ -48,7 +48,7 @@ question(bool preset, const char *fmt, va_list ap)
else
fputs(" [y/N] ", stderr);
if ((response = fgetc(stdin))) {
if ((response = fgetc(stdin)) != EOF) {
if (response == '\n')
return preset;
if (response == 'y' || response == 'Y')