Fix a warning

This commit is contained in:
vitaut 2015-12-04 14:12:42 -08:00
parent 0ea73df717
commit 7c60db1e24

View File

@ -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;
}