Fix utf8::to_previous that could go before the begin iterator
This commit is contained in:
parent
397e5ef0e1
commit
78d7d512cb
|
@ -157,7 +157,7 @@ void to_previous(Iterator& it, const Iterator& begin) noexcept
|
|||
{
|
||||
if (it != begin)
|
||||
--it;
|
||||
while (not is_character_start(*it))
|
||||
while (it != begin and not is_character_start(*it))
|
||||
--it;
|
||||
}
|
||||
// returns an iterator to the previous character first byte
|
||||
|
|
Loading…
Reference in New Issue
Block a user