Fix potential segfault when exceptions are disabled

This commit is contained in:
vitaut
2015-10-20 06:23:16 -07:00
parent a9582bb1a2
commit 22d572d7a2

View File

@ -782,7 +782,7 @@ void fmt::BasicWriter<Char>::write_str(
if (str_size == 0) { if (str_size == 0) {
if (!str_value) if (!str_value)
FMT_THROW(FormatError("string pointer is null")); FMT_THROW(FormatError("string pointer is null"));
if (*str_value) else if (*str_value)
str_size = std::char_traits<StrChar>::length(str_value); str_size = std::char_traits<StrChar>::length(str_value);
} }
std::size_t precision = spec.precision_; std::size_t precision = spec.precision_;