Fix: Stream: Replace fflush() with fseek()

This is a follow-up to PR #8331; fixing the Stream methods not covered
there.
pull/9033/head
Filip Jagodzinski 2018-12-10 12:13:55 +01:00
parent 5c9cc5b8f1
commit 89a475bc4e
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ int Stream::printf(const char *format, ...)
lock();
std::va_list arg;
va_start(arg, format);
fflush(_file);
std::fseek(_file, 0, SEEK_CUR);
int r = vfprintf(_file, format, arg);
va_end(arg);
unlock();
@ -169,7 +169,7 @@ int Stream::scanf(const char *format, ...)
int Stream::vprintf(const char *format, std::va_list args)
{
lock();
fflush(_file);
std::fseek(_file, 0, SEEK_CUR);
int r = vfprintf(_file, format, args);
unlock();
return r;