670a671
> int len;
682c683,685
< if (p + utf_len(*p) > limit)
---
> len = utf_len(*p);
> if (p + len > limit)
> {
684c687,688
< else
---
> p = limit;
> } else
687,689c691
< p++;
< while (IS_UTF8_TRAIL(*p))
< p++;
---
> p += len;
> int len;
682c683,685
< if (p + utf_len(*p) > limit)
---
> len = utf_len(*p);
> if (p + len > limit)
> {
684c687,688
< else
---
> p = limit;
> } else
687,689c691
< p++;
< while (IS_UTF8_TRAIL(*p))
< p++;
---
> p += len;