From aa42121fcd38b5c59fda786475f20595fb0b0de2 Mon Sep 17 00:00:00 2001 From: Filip Jagodzinski Date: Mon, 10 Dec 2018 12:13:55 +0100 Subject: [PATCH] Fix: Stream: Replace fflush() with fseek() This is a follow-up to PR #8331; fixing the Stream methods not covered there. --- platform/Stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/Stream.cpp b/platform/Stream.cpp index 5c45c6c79f..bdc7af9177 100644 --- a/platform/Stream.cpp +++ b/platform/Stream.cpp @@ -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;