Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ FMT_FUNC void report_error(format_func func, int error_code,
memory_buffer full_message;
func(full_message, error_code, message);
// Don't use fwrite_fully because the latter may throw.
(void)std::fwrite(full_message.data(), full_message.size(), 1, stderr);
if (std::fwrite(full_message.data(), full_message.size(), 1, stderr)) {
;
}
std::fputc('\n', stderr);
Comment on lines 158 to 161

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't be trying to write \n if an error occurs which will also solve the warning:

  if (std::fwrite(full_message.data(), full_message.size(), 1, stderr) > 0)
    std::fputc('\n', stderr);

}

Expand Down