1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 10:59:12 +00:00

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

This commit is contained in:
frosch
2025-04-03 13:56:50 +02:00
committed by GitHub
parent ced8fd9936
commit 061b5630ee

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) {