mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
fix(mbyte): fix bugs in utf_cp_*_off() functions
Problems: - Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail. - When stream isn't NUL-terminated, utf_cp_*_off() may go over the end. Solution: Don't go over end of the char of end of the string.
This commit is contained in:
@@ -3436,7 +3436,7 @@ void maketitle(void)
|
||||
int len = (int)strlen(buf_p);
|
||||
if (len > 100) {
|
||||
len -= 100;
|
||||
len += utf_cp_tail_off(buf_p, buf_p + len) + 1;
|
||||
len += utf_cp_bounds(buf_p, buf_p + len).end_off;
|
||||
buf_p += len;
|
||||
}
|
||||
STRCPY(icon_str, buf_p);
|
||||
|
Reference in New Issue
Block a user