mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-13 17:20:09 +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)
|
||||
{
|
||||
|
||||
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");
|
||||
}
|
||||
if (str == nullptr) {
|
||||
|
@ -146,7 +146,7 @@ public:
|
|||
bool
|
||||
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");
|
||||
}
|
||||
if (str == nullptr) {
|
||||
|
|
Loading…
Reference in a new issue