From: Stefano Sabatini Date: Wed, 18 Mar 2009 21:34:19 +0000 (+0000) Subject: Flush the remaning chars in the input buffer after reading the X-Git-Tag: v0.6~5267 X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=eab5168cd345a5ce0001036690daac7767062aa1;hp=1e896640c401cff430c6b11e203b23d6c0b2c635 Flush the remaning chars in the input buffer after reading the response to the "Overwrite ? [y/N]" question. Fix the behaviour when the question is asked more than one time. Originally committed as revision 18036 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/ffmpeg.c b/ffmpeg.c index 57770e630d..c4f910d1cd 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3404,6 +3404,8 @@ static void opt_output_file(const char *filename) fprintf(stderr, "Not overwriting - exiting\n"); av_exit(1); } + while (c != '\n' && c != EOF) + c = getchar(); } else { fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);