From f3bacced244b90975ceb6e7c283413d34761e26c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 8 Oct 2011 19:43:10 +0200 Subject: ffmpeg: fix read_yn() if HAVE_TERMIOS_H || HAVE_KBHIT == 0 Signed-off-by: Michael Niedermayer --- ffmpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 5e9fcf197c..b290022d02 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -611,11 +611,13 @@ static int read_key(void) static int read_yn(void) { - int c; + int c, t; #if HAVE_TERMIOS_H || HAVE_KBHIT while((c=read_key()) < 0); #else - c= getchar(); + t=c= getchar(); + while (t != '\n' && t != EOF) + t = getchar(); #endif return (toupper(c) == 'Y'); -- cgit v1.2.3