1
0
Fork 0

Codefix: Conversion from char to char32_t requires cast to unsigned first. (#13950)

pull/13959/head
frosch 2025-04-03 13:56:50 +02:00 committed by GitHub
parent ced8fd9936
commit 061b5630ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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) {