mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lint
This commit is contained in:
parent
52e56954c6
commit
532197b4f9
@ -259,8 +259,9 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
||||
return;
|
||||
}
|
||||
n = ptr2cells(s + e);
|
||||
if (len + n > half)
|
||||
if (len + n > half) {
|
||||
break;
|
||||
}
|
||||
len += n;
|
||||
buf[e] = s[e];
|
||||
if (has_mbyte)
|
||||
@ -303,8 +304,9 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
||||
// set the middle and copy the last part
|
||||
memmove(buf + e, "...", (size_t)3);
|
||||
len = STRLEN(s + i) + 1;
|
||||
if (len >= (size_t)buflen - e - 3)
|
||||
if (len >= (size_t)buflen - e - 3) {
|
||||
len = buflen - e - 3 - 1;
|
||||
}
|
||||
memmove(buf + e + 3, s + i, len);
|
||||
buf[e + 3 + len - 1] = NUL;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user