Commit dd322c68 authored by stefano's avatar stefano

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18036 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f4b2d302
...@@ -3404,6 +3404,8 @@ static void opt_output_file(const char *filename) ...@@ -3404,6 +3404,8 @@ static void opt_output_file(const char *filename)
fprintf(stderr, "Not overwriting - exiting\n"); fprintf(stderr, "Not overwriting - exiting\n");
av_exit(1); av_exit(1);
} }
while (c != '\n' && c != EOF)
c = getchar();
} }
else { else {
fprintf(stderr,"File '%s' already exists. Exiting.\n", filename); fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment