mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 09:28:21 +00:00
Fix a warning
This commit is contained in:
parent
0ea73df717
commit
7c60db1e24
4
format.h
4
format.h
@ -3383,7 +3383,9 @@ int parse_nonnegative_int(const Char *&s) {
|
||||
}
|
||||
value = new_value;
|
||||
} while ('0' <= *s && *s <= '9');
|
||||
if (value > (std::numeric_limits<int>::max)())
|
||||
// Convert to unsigned to prevent a warning.
|
||||
unsigned max_int = (std::numeric_limits<int>::max)();
|
||||
if (value > max_int)
|
||||
FMT_THROW(FormatError("number is too big"));
|
||||
return value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user