From 9bbec3b49e6c5852d444c6bb530a549d292c50bf Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 25 Nov 2023 12:40:13 -0800 Subject: [PATCH] fix signed value check in Arguments::get --- src/Arguments.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arguments.hh b/src/Arguments.hh index fd75e27..cf95606 100644 --- a/src/Arguments.hh +++ b/src/Arguments.hh @@ -218,7 +218,7 @@ private: } return uv; } else { - if (((uv & (~mask_for_type)) != 0) && ((uv & (~mask_for_type)) != (~mask_for_type))) { + if (((uv & (~(mask_for_type >> 1))) != 0) && ((uv & (~(mask_for_type >> 1))) != (~(mask_for_type >> 1)))) { throw std::invalid_argument(exc_prefix(id) + "signed value out of range"); } return v;