/W4: Fix incorrect type cast

Values passed to functions from '<cctype>' must be representable as unsigned chars to avoid undefined behavior.
This commit is contained in:
Kawe Mazidjatari 2023-04-02 14:58:02 +02:00
parent 0f461b7695
commit 978f108526

View File

@ -243,8 +243,8 @@ char* StripQuotes(const char* pInBuffer, char* pOutBuffer, int nOutBufferSize)
// For finding a partial string within input (case insensitive).
bool HasPartial(const string& svInput, const string& svPartial)
{
auto it = std::search( svInput.begin(), svInput.end(),
svPartial.begin(), svPartial.end(), [](char ci, char cp)
auto it = std::search(svInput.begin(), svInput.end(),
svPartial.begin(), svPartial.end(), [](unsigned char ci, unsigned char cp)
{
return std::toupper(ci) == std::toupper(cp);
}