Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build under g++-4.9, SunOS 5.11 i386 i86pc Solaris #138

Merged
merged 1 commit into from
Mar 18, 2015
Merged
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
8 changes: 4 additions & 4 deletions format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ void format_error_code(fmt::Writer &out, int error_code,
// bad_alloc.
out.clear();
static const char SEP[] = ": ";
static const char ERR[] = "error ";
static const char _ERR[] = "error ";
fmt::internal::IntTraits<int>::MainType ec_value = error_code;
// Subtract 2 to account for terminating null characters in SEP and ERR.
// Subtract 2 to account for terminating null characters in SEP and _ERR.
std::size_t error_code_size =
sizeof(SEP) + sizeof(ERR) + fmt::internal::count_digits(ec_value) - 2;
sizeof(SEP) + sizeof(_ERR) + fmt::internal::count_digits(ec_value) - 2;
if (message.size() <= fmt::internal::INLINE_BUFFER_SIZE - error_code_size)
out << message << SEP;
out << ERR << error_code;
out << _ERR << error_code;
assert(out.size() <= fmt::internal::INLINE_BUFFER_SIZE);
}

Expand Down