From 8552caacf6c9960c3723c4e2bca4cdd419336b0c Mon Sep 17 00:00:00 2001 From: MacroModel <33865334+MacroModel@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:32:46 +0800 Subject: [PATCH] (wincrt) output all content when overflow --- include/fast_io_legacy_impl/c/wincrt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/fast_io_legacy_impl/c/wincrt.h b/include/fast_io_legacy_impl/c/wincrt.h index ca75fa49..e1b58ff2 100644 --- a/include/fast_io_legacy_impl/c/wincrt.h +++ b/include/fast_io_legacy_impl/c/wincrt.h @@ -240,10 +240,8 @@ inline void wincrt_fp_overflow_impl(FILE *__restrict fpp, char_type ch) } else { - // output existing content - ::fast_io::details::posix_write_bytes_impl(fp->_file, reinterpret_cast<::std::byte const *>(fp->_base), reinterpret_cast<::std::byte const *>(fp->_ptr)); - // ?? output all content ?? - // ::fast_io::details::posix_write_bytes_impl(fp->_file, reinterpret_cast<::std::byte const *>(fp->_base), reinterpret_cast<::std::byte const *>(fp->_base + fp->_bufsiz)); + // output all content + ::fast_io::details::posix_write_bytes_impl(fp->_file, reinterpret_cast<::std::byte const *>(fp->_base), reinterpret_cast<::std::byte const *>(fp->_base + fp->_bufsiz)); } fp->_ptr = fp->_base; my_memcpy(fp->_ptr, __builtin_addressof(ch), sizeof(ch));