Skip to content

Commit aa42121

Browse files
Filip JagodzinskiCruz Monrreal II
authored andcommitted
Fix: Stream: Replace fflush() with fseek()
This is a follow-up to PR #8331; fixing the Stream methods not covered there.
1 parent 2ec7bdd commit aa42121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/Stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int Stream::printf(const char *format, ...)
147147
lock();
148148
std::va_list arg;
149149
va_start(arg, format);
150-
fflush(_file);
150+
std::fseek(_file, 0, SEEK_CUR);
151151
int r = vfprintf(_file, format, arg);
152152
va_end(arg);
153153
unlock();
@@ -169,7 +169,7 @@ int Stream::scanf(const char *format, ...)
169169
int Stream::vprintf(const char *format, std::va_list args)
170170
{
171171
lock();
172-
fflush(_file);
172+
std::fseek(_file, 0, SEEK_CUR);
173173
int r = vfprintf(_file, format, args);
174174
unlock();
175175
return r;

0 commit comments

Comments
 (0)