mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 09:22:42 +01:00
Codefix: std::string_view::data() is not necessarily null terminated. (#13891)
This commit is contained in:
@@ -444,7 +444,7 @@ void Textbuf::Assign(const std::string_view text)
|
||||
*/
|
||||
void Textbuf::UpdateSize()
|
||||
{
|
||||
this->chars = static_cast<uint16_t>(Utf8StringLength(this->buf.data()) + 1); // terminating zero
|
||||
this->chars = static_cast<uint16_t>(Utf8StringLength(this->buf.c_str()) + 1); // terminating zero
|
||||
assert(this->buf.size() < this->max_bytes);
|
||||
assert(this->chars <= this->max_chars);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user