gui/InputField: Calculate correct length for the returned StringView

This commit is contained in:
apio 2024-12-14 12:46:14 +01:00
parent 48ee803e58
commit 5d5c85a022
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -115,7 +115,7 @@ namespace ui
StringView InputField::data() StringView InputField::data()
{ {
if (!m_data.size()) return StringView {}; if (m_data.size() < 2) return StringView {};
return StringView { (const char*)m_data.data(), m_data.size() }; return StringView { (const char*)m_data.data(), m_data.size() - 1 };
} }
} }