1
0
Fork 0

Codefix: Conversion from char to char32_t requires cast to unsigned first.

pull/13950/head
frosch 2025-04-01 19:59:03 +02:00
parent 2ae84f3c9e
commit 82609bdcda
1 changed files with 3 additions and 2 deletions

View File

@ -66,8 +66,9 @@ std::string CopyFromOldName(StringID id)
std::ostringstream tmp;
std::ostreambuf_iterator<char> strto(tmp);
for (char32_t c : strfrom) {
if (c == '\0') break;
for (char s : strfrom) {
if (s == '\0') break;
char32_t c = static_cast<uint8_t>(s); // cast to unsigned before integer promotion
/* Map from non-ISO8859-15 characters to UTF-8. */
switch (c) {