A wrapper around fwrite that throws on error.
| 164 | |
| 165 | // A wrapper around fwrite that throws on error. |
| 166 | FMT_FUNC void fwrite_fully(const void* ptr, size_t size, size_t count, |
| 167 | FILE* stream) { |
| 168 | size_t written = std::fwrite(ptr, size, count, stream); |
| 169 | if (written < count) FMT_THROW(system_error(errno, "cannot write to file")); |
| 170 | } |
| 171 | } // namespace internal |
| 172 | |
| 173 | #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) |
no test coverage detected