mirror of
https://github.com/nlohmann/json.git
synced 2025-06-12 03:22:48 +08:00
Merge pull request #2144 from XyFreak/gcc10_type_limits
Fix issue#1939: Cast character to unsigned for comparison
This commit is contained in:
commit
61832afe15
@ -1367,7 +1367,7 @@ scan_number_done:
|
|||||||
std::string result;
|
std::string result;
|
||||||
for (const auto c : token_string)
|
for (const auto c : token_string)
|
||||||
{
|
{
|
||||||
if ('\x00' <= c and c <= '\x1F')
|
if (static_cast<unsigned char>(c) <= '\x1F')
|
||||||
{
|
{
|
||||||
// escape control characters
|
// escape control characters
|
||||||
std::array<char, 9> cs{{}};
|
std::array<char, 9> cs{{}};
|
||||||
|
@ -9457,7 +9457,7 @@ scan_number_done:
|
|||||||
std::string result;
|
std::string result;
|
||||||
for (const auto c : token_string)
|
for (const auto c : token_string)
|
||||||
{
|
{
|
||||||
if ('\x00' <= c and c <= '\x1F')
|
if (static_cast<unsigned char>(c) <= '\x1F')
|
||||||
{
|
{
|
||||||
// escape control characters
|
// escape control characters
|
||||||
std::array<char, 9> cs{{}};
|
std::array<char, 9> cs{{}};
|
||||||
|
Loading…
Reference in New Issue
Block a user