Workaround bogus coverity warnings

This commit is contained in:
vitaut
2015-10-21 06:16:55 -07:00
parent adee0dfc39
commit cd097d334e
2 changed files with 6 additions and 5 deletions

View File

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