summaryrefslogtreecommitdiff
path: root/Libraries/LibC/stdio.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-27 09:32:43 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-27 10:15:42 +0200
commit676af444ca80cc9885ba9b1950e5179aeb4fb4fa (patch)
treebbd81d7ccadc526d01094d7d2285f3acbc888cf2 /Libraries/LibC/stdio.cpp
parent9470db92f47ce79ad18c3476561119d428f81c65 (diff)
downloadserenity-676af444ca80cc9885ba9b1950e5179aeb4fb4fa.zip
LibC: Clear any ungetc()'ed data in fflush()
Diffstat (limited to 'Libraries/LibC/stdio.cpp')
-rw-r--r--Libraries/LibC/stdio.cpp2
1 files changed, 2 insertions, 0 deletions
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;