mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:8.2.4397: crash when using many composing characters in error message (#23481)
Problem: Crash when using many composing characters in error message.
Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
34f8117dec
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -121,7 +121,7 @@ static void ga_concat_shorten_esc(garray_T *gap, const char *str)
|
||||
for (const char *p = str; *p != NUL; p++) {
|
||||
int same_len = 1;
|
||||
const char *s = p;
|
||||
const int c = mb_ptr2char_adv(&s);
|
||||
const int c = mb_cptr2char_adv(&s);
|
||||
const int clen = (int)(s - p);
|
||||
while (*s != NUL && c == utf_ptr2char(s)) {
|
||||
same_len++;
|
||||
|
Reference in New Issue
Block a user