AGS: Fix String::ClipRight causing access violation for empty string

From upstream b1602096ec06aae8f045c0037298d61846111aa0
This commit is contained in:
Paul Gilbert 2022-03-30 22:09:12 -07:00
parent 0f6ca133d2
commit b615ca27b3

View File

@ -497,7 +497,7 @@ void String::ClipMid(size_t from, size_t count) {
}
void String::ClipRight(size_t count) {
if (count > 0) {
if (_len > 0 && count > 0) {
count = Math::Min(count, _len);
BecomeUnique();
_len -= count;