1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Fix undefined use of cctype functions

This commit is contained in:
Hielke Morsink
2021-10-28 10:54:09 +02:00
parent b21643a692
commit 76b5479bbb
7 changed files with 16 additions and 15 deletions

View File

@@ -178,7 +178,7 @@ namespace String
{
for (size_t i = 0; i < a.size(); i++)
{
if (tolower(a[i]) != tolower(b[i]))
if (tolower(static_cast<unsigned char>(a[i])) != tolower(static_cast<unsigned char>(b[i])))
{
return false;
}
@@ -212,7 +212,7 @@ namespace String
return false;
}
}
else if (tolower(ai) != tolower(bi))
else if (tolower(static_cast<unsigned char>(ai)) != tolower(static_cast<unsigned char>(bi)))
{
return false;
}
@@ -822,7 +822,7 @@ namespace String
for (auto c : value)
{
// Keep alphanumeric and other accepted characters intact
if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~')
if (std::isalnum(static_cast<unsigned char>(c)) || c == '-' || c == '_' || c == '.' || c == '~')
{
escaped << c;
}