diff options
Diffstat (limited to 'log.h')
-rw-r--r-- | log.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -167,11 +167,11 @@ constexpr void logger<WithTimestamp, BufSize>::log(const char* fmt, assert(pos < BufSize); // Ensure terminated with new line and null terminator. - assert(pos < BufSize - 1); - m_buf[pos++] = '\0'; + assert(pos < BufSize); + m_buf[pos++] = '\n'; // Write out log message. - std::fprintf(stderr, "%s\n", m_buf); + std::fwrite(m_buf, pos < BufSize ? pos : BufSize, 1 /* nmemb */, stderr); } } // namespace logging |