fix sonar fail for special characters in strings (ascii>127)

This commit is contained in:
MichaelDvP
2025-03-11 10:00:10 +01:00
parent 6df592c2b8
commit 79cc0377c0

View File

@@ -96,9 +96,9 @@ std::deque<Token> exprToTokens(const std::string & expr) {
} else if (strncmp(p, "hex", 3) == 0) { } else if (strncmp(p, "hex", 3) == 0) {
p += 2; p += 2;
tokens.emplace_back(Token::Type::Unary, "h", 5); tokens.emplace_back(Token::Type::Unary, "h", 5);
} else if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z')) { } else if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p == '_') || (*p & 0x80)) {
const auto * b = p; const auto * b = p;
while ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p == '_') || (*p > 127)) { while ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p == '_') || (*p & 0x80)) {
++p; ++p;
} }
const auto s = std::string(b, p); const auto s = std::string(b, p);