mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Workaround bogus coverity warnings
This commit is contained in:
parent
adee0dfc39
commit
cd097d334e
@ -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_;
|
||||
|
@ -337,10 +337,9 @@ void TestLength(const char *length_spec) {
|
||||
TestLength<T>(length_spec, min);
|
||||
TestLength<T>(length_spec, max);
|
||||
using fmt::internal::check;
|
||||
if (check(min >= 0 || static_cast<fmt::LongLong>(min) >
|
||||
std::numeric_limits<fmt::LongLong>::min())) {
|
||||
fmt::LongLong long_long_min = std::numeric_limits<fmt::LongLong>::min();
|
||||
if (check(min >= 0) || check(static_cast<fmt::LongLong>(min) > long_long_min))
|
||||
TestLength<T>(length_spec, fmt::LongLong(min) - 1);
|
||||
}
|
||||
fmt::ULongLong long_long_max = std::numeric_limits<fmt::LongLong>::max();
|
||||
if (check(max < 0 || static_cast<fmt::ULongLong>(max) < long_long_max))
|
||||
TestLength<T>(length_spec, fmt::LongLong(max) + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user