diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 4a36ab06..cf38a813 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -1367,7 +1367,7 @@ scan_number_done: std::string result; for (const auto c : token_string) { - if ('\x00' <= c and c <= '\x1F') + if (static_cast(c) <= '\x1F') { // escape control characters std::array cs{{}}; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 70ce011a..38e51596 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -9456,7 +9456,7 @@ scan_number_done: std::string result; for (const auto c : token_string) { - if ('\x00' <= c and c <= '\x1F') + if (static_cast(c) <= '\x1F') { // escape control characters std::array cs{{}};