mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
a/util: Guard against bad defs of "max"
This commit is contained in:
parent
b37a89e312
commit
842c160c49
|
@ -88,7 +88,7 @@ public:
|
||||||
push_back(const char *str)
|
push_back(const char *str)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (vec.size() > std::numeric_limits<uint32_t>::max() - 1) {
|
if (vec.size() > (std::numeric_limits<uint32_t>::max)() - 1) {
|
||||||
throw std::out_of_range("Size limit reached");
|
throw std::out_of_range("Size limit reached");
|
||||||
}
|
}
|
||||||
if (str == nullptr) {
|
if (str == nullptr) {
|
||||||
|
@ -146,7 +146,7 @@ public:
|
||||||
bool
|
bool
|
||||||
push_back_unique(const char *str)
|
push_back_unique(const char *str)
|
||||||
{
|
{
|
||||||
if (vec.size() > std::numeric_limits<uint32_t>::max() - 1) {
|
if (vec.size() > (std::numeric_limits<uint32_t>::max)() - 1) {
|
||||||
throw std::out_of_range("Size limit reached");
|
throw std::out_of_range("Size limit reached");
|
||||||
}
|
}
|
||||||
if (str == nullptr) {
|
if (str == nullptr) {
|
||||||
|
|
Loading…
Reference in a new issue