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

@ -773,7 +773,7 @@ bool WMORenderer::loadModel(const pipeline::WMOModel& model, uint32_t id) {
// Convert .mdx/.mdl to .m2
if (m2Path.size() > 4) {
std::string ext = m2Path.substr(m2Path.size() - 4);
for (char& c : ext) c = std::tolower(c);
for (char& c : ext) c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
if (ext == ".mdx" || ext == ".mdl") {
m2Path = m2Path.substr(0, m2Path.size() - 4) + ".m2";
}