mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 13:45:15 -07:00
vim-patch:8.2.2515: memory access error when truncating an empty message
Problem: Memory access error when truncating an empty message.
Solution: Check for an empty string. (Dominique Pellé, closes vim/vim#7841)
6281815ecc
This commit is contained in:
parent
47630743fc
commit
e2247c0baa
@ -382,6 +382,13 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
||||
int i;
|
||||
int n;
|
||||
|
||||
if (*s == NUL) {
|
||||
if (buflen > 0) {
|
||||
*buf = NUL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (room_in < 3) {
|
||||
room = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user