1
0
mirror of https://github.com/nlohmann/json synced 2024-11-12 23:40:05 +00:00

Cast character to unsigned for comparison

This commit is contained in:
Tobias Kux 2020-05-27 13:15:31 +02:00
parent d70d06ae41
commit 23051df2c7
2 changed files with 2 additions and 2 deletions

View File

@ -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<unsigned char>(c) <= '\x1F')
{
// escape control characters
std::array<char, 9> cs{{}};

View File

@ -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<unsigned char>(c) <= '\x1F')
{
// escape control characters
std::array<char, 9> cs{{}};