fix a minor crash
This commit is contained in:
parent
2a55642ed8
commit
8b4a2fb064
1 changed files with 1 additions and 1 deletions
|
@ -433,7 +433,7 @@ int UTF8GetPrev(const std::string &text, int curpos)
|
|||
return curpos;
|
||||
}
|
||||
while (curpos >= 0) {
|
||||
if ((text[curpos] & 0xC0) != 0x80) {
|
||||
if (curpos < text.size() && (text[curpos] & 0xC0) != 0x80) {
|
||||
return curpos;
|
||||
}
|
||||
--curpos;
|
||||
|
|
Loading…
Add table
Reference in a new issue