fix: tolower/toupper UB on signed char at 10 remaining call sites

Final sweep across mpq_manager, application, auth_screen, wmo_renderer,
character_renderer, and terrain_manager. All now use the unsigned char
cast pattern. No remaining bare ::tolower/::toupper or std::tolower(c)
calls on signed char in the codebase.
This commit is contained in:
Kelsi 2026-03-29 20:27:16 -07:00
parent 34e384e1b2
commit f02be1ffac
6 changed files with 13 additions and 11 deletions

View file

@ -1002,7 +1002,7 @@ VkTexture* CharacterRenderer::compositeTextures(const std::vector<std::string>&
int dstX = 0, dstY = 0;
int expectedW256 = 0, expectedH256 = 0; // Expected size at 256-base
std::string pathLower = layerPaths[layer];
for (auto& c : pathLower) c = std::tolower(c);
for (auto& c : pathLower) c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
if (pathLower.find("faceupper") != std::string::npos) {
dstX = faceUpperRegion256.x; dstY = faceUpperRegion256.y;
@ -1220,7 +1220,7 @@ VkTexture* CharacterRenderer::compositeWithRegions(const std::string& basePath,
// WoW 256-scale atlas coordinates (from CharComponentTextureSections)
int dstX = 0, dstY = 0;
std::string pathLower = ul;
for (auto& c : pathLower) c = std::tolower(c);
for (auto& c : pathLower) c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
// Scale factor from 256-base coordinates to actual canvas size
int coordScale = width / 256;