mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Fix a warning
This commit is contained in:
4
format.h
4
format.h
@ -3383,7 +3383,9 @@ int parse_nonnegative_int(const Char *&s) {
|
|||||||
}
|
}
|
||||||
value = new_value;
|
value = new_value;
|
||||||
} while ('0' <= *s && *s <= '9');
|
} 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"));
|
FMT_THROW(FormatError("number is too big"));
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user