diff --git a/tests/stringparsingcheck.cpp b/tests/stringparsingcheck.cpp index 57e8d8dd..f78aea4c 100644 --- a/tests/stringparsingcheck.cpp +++ b/tests/stringparsingcheck.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -70,10 +71,17 @@ static bool parse_string(const char *p, char *output, char **end) { p++; for (;;) { - +#if (CHAR_MIN < 0) || (!defined(CHAR_MIN)) // the '!defined' is just paranoia + // in this path, char is *signed* if ((*p >= 0 && *p < 0x20)) { return false; // unescaped } +#else + // we have unsigned chars + if (*p < 0x20) { + return false; // unescaped + } +#endif switch (*p) { case '"':