Problem: ASAN error when using text from the clipboard.
Solution: Get width of each character.
{
charlen = 0;
for (i = start; i < len; ++i) // find the end of the line
+ {
if (str[i] == '\n')
break;
+ charlen += mb_ptr2cells_len(str + i, len - i);
+ }
i -= start; // i is now length of line
- if (start < len)
- charlen = mb_charlen_len(str + start, i);
if (charlen > maxlen)
maxlen = charlen;
if (append)
mch_memmove(s, y_ptr->y_array[lnum], (size_t)extra);
if (append)
vim_free(y_ptr->y_array[lnum]);
- if (i)
+ if (i > 0)
mch_memmove(s + extra, str + start, (size_t)i);
extra += i;
s[extra] = NUL;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2934,
/**/
2933,
/**/