mirror of
https://github.com/nlohmann/json.git
synced 2026-10-19 12:38:12 +00:00
Cast character to unsigned for comparison
This commit is contained in:
1 parent
d70d06ae41
commit
23051df2c7
2 files changed
+2
-2
No files matched your search
@@ -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{{}};
|
||||||
|
|||||||
@@ -9456,7 +9456,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{{}};
|
||||||
|
|||||||
Reference in new issue
Block a user