1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00

Prevent input type assertion

This commit is contained in:
Evil Eye 2024-01-01 12:48:12 +01:00
parent 78459314bf
commit b835114ce2

View File

@ -70,7 +70,11 @@ namespace Compiler
&& mData[3] == 0;
}
bool isDigit() const { return std::isdigit(mData[0]) && mData[1] == 0 && mData[2] == 0 && mData[3] == 0; }
bool isDigit() const
{
return std::isdigit(static_cast<unsigned char>(mData[0])) && mData[1] == 0 && mData[2] == 0
&& mData[3] == 0;
}
bool isMinusSign() const
{
@ -85,7 +89,8 @@ namespace Compiler
if (isMinusSign())
return false;
return std::isalpha(mData[0]) || mData[1] != 0 || mData[2] != 0 || mData[3] != 0;
return std::isalpha(static_cast<unsigned char>(mData[0])) || mData[1] != 0 || mData[2] != 0
|| mData[3] != 0;
}
void appendTo(std::string& str) const