From 676af444ca80cc9885ba9b1950e5179aeb4fb4fa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 27 Sep 2019 09:32:43 +0200 Subject: [PATCH] LibC: Clear any ungetc()'ed data in fflush() --- Libraries/LibC/stdio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 6161d21c7c..c6cbddd4db 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -96,6 +96,8 @@ int fflush(FILE* stream) stream->buffer_index = 0; stream->error = 0; stream->eof = 0; + stream->have_ungotten = false; + stream->ungotten = 0; if (rc < 0) { stream->error = errno; return EOF;