Fix dereferencing invalid iterator in wxString in UTF-8 build

Fix iterator going past end of string in PosLenToImpl, it can't become
end() as the end iterator can't be dereferenced.

Closes #23305.
This commit is contained in:
Ian Day
2023-03-24 19:18:30 +01:00
committed by Vadim Zeitlin
parent ad29bdc6e4
commit 73ad17db4e
+1 -1
View File
@@ -229,7 +229,7 @@ void wxString::PosLenToImpl(size_t pos, size_t len,
// going beyond the end of the string, just as std::string does
const const_iterator e(end());
const_iterator i(b);
while ( len && i <= e )
while ( len && i < e )
{
++i;
--len;