diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index e061622f9412..8b1c2febb889 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1512,6 +1512,7 @@ template class glibc_file : public file_base { void init_buffer() { if (this->file_->_IO_write_ptr) return; // Force buffer initialization by placing and removing a char in a buffer. + assume(this->file_->_IO_write_ptr >= this->file_->_IO_write_end); putc_unlocked(0, this->file_); --this->file_->_IO_write_ptr; }