1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

When calling code has length of string, pass it to parse_utf8

This commit is contained in:
Kiro
2024-11-29 14:35:02 +01:00
parent 0eadbdb5d0
commit 83d4bde0a2
10 changed files with 13 additions and 15 deletions

View File

@@ -165,7 +165,7 @@ StringName ResourceLoaderBinary::_get_string() {
}
f->get_buffer((uint8_t *)&str_buf[0], len);
String s;
s.parse_utf8(&str_buf[0]);
s.parse_utf8(&str_buf[0], len);
return s;
}
@@ -921,7 +921,7 @@ static String get_ustring(Ref<FileAccess> f) {
str_buf.resize(len);
f->get_buffer((uint8_t *)&str_buf[0], len);
String s;
s.parse_utf8(&str_buf[0]);
s.parse_utf8(&str_buf[0], len);
return s;
}
@@ -935,7 +935,7 @@ String ResourceLoaderBinary::get_unicode_string() {
}
f->get_buffer((uint8_t *)&str_buf[0], len);
String s;
s.parse_utf8(&str_buf[0]);
s.parse_utf8(&str_buf[0], len);
return s;
}