From 1eeaa99438556689982707fdf10276858948457f Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Sat, 14 Mar 2015 00:41:39 +0100 Subject: [PATCH] utils: test for EOF on error, not for \0. --- bin/xbps-install/question.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xbps-install/question.c b/bin/xbps-install/question.c index e4c73bb6..1d61af29 100644 --- a/bin/xbps-install/question.c +++ b/bin/xbps-install/question.c @@ -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')