Replace CHAR_MAX with numeric_limits
Clang analyzer complains on this one about loading an int (CHAR_MAX)
into a char, and that it might overflow. Obviously it can't, but we
might as well suppress the warning.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9b8149504ab3c016fc75f0a84bb5c6d04f9c013f
diff --git a/redfish-core/ut/hex_utils_test.cpp b/redfish-core/ut/hex_utils_test.cpp
index 5084b8b..21387c6 100644
--- a/redfish-core/ut/hex_utils_test.cpp
+++ b/redfish-core/ut/hex_utils_test.cpp
@@ -31,7 +31,7 @@
TEST(HexCharToNibble, chars)
{
- for (char c = 0; c < CHAR_MAX; ++c)
+ for (char c = 0; c < std::numeric_limits<char>::max(); ++c)
{
uint8_t expected = 16;
if (isdigit(c) != 0)