[libcxx-commits] [libcxx] [libc++] Refactor basic_filebuf::overflow() (PR #144793)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jun 20 09:02:48 PDT 2025
================
@@ -835,35 +835,50 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
}
if (this->pptr() != this->pbase()) {
if (__always_noconv_) {
- size_t __nmemb = static_cast<size_t>(this->pptr() - this->pbase());
- if (std::fwrite(this->pbase(), sizeof(char_type), __nmemb, __file_) != __nmemb)
+ size_t __n = static_cast<size_t>(this->pptr() - this->pbase());
----------------
ldionne wrote:
Hmm. This isn't really the size of the put area though, as that would be `epptr() - pbase()`. This is really the number of characters inside the put area that we want to write to the underlying file stream.
https://github.com/llvm/llvm-project/pull/144793
More information about the libcxx-commits
mailing list