Workaround bogus coverity warnings

This commit is contained in:
vitaut committed 2015-10-21 06:16:55 -07:00
1 parent adee0dfc39
commit cd097d334e
2 files changed
+6 -5

No files matched your search

+4 -2
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_;