mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-22 11:44:17 +01:00
Codefix: std::string_view::data() is not necessarily null terminated. (#13891)
This commit is contained in:
@@ -297,7 +297,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint first, uint last, int prop, Byt
|
||||
* such as Cyrillic. Thus we will simply assume they're all UTF8. */
|
||||
char32_t c;
|
||||
size_t len = Utf8Decode(&c, name.data());
|
||||
if (c == NFO_UTF8_IDENTIFIER) name = name.substr(len);
|
||||
if (len <= name.size() && c == NFO_UTF8_IDENTIFIER) name = name.substr(len);
|
||||
|
||||
LanguageMap::Mapping map;
|
||||
map.newgrf_id = newgrf_id;
|
||||
|
||||
Reference in New Issue
Block a user