String.Right() does not crash anymore on invalid UTF-8 strings.
[INTERPRETER] * BUG: String.Right() does not crash anymore on invalid UTF-8 strings.
This commit is contained in:
parent
463bc16b47
commit
c7d6ddd31f
1 changed files with 3 additions and 1 deletions
|
@ -535,6 +535,8 @@ static void String_Right(ushort code)
|
|||
val = utf8_get_length(str, len) - val;
|
||||
|
||||
ulen = utf8_get_pos(ref, str, len, val);
|
||||
if (ulen > len)
|
||||
ulen = len;
|
||||
|
||||
PARAM->_string.start += ulen;
|
||||
PARAM->_string.len -= ulen;
|
||||
|
|
Loading…
Reference in a new issue