diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-22 13:15:52 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-09-22 13:17:43 +0800 |
commit | 1bced9bf94f2767ad5bb91cc902cd58fc126055e (patch) | |
tree | 1567bd79734174281cf7a6a285970967845be46d /src/nvim/statusline.c | |
parent | a636e24280abdd2cfe0c0ae6a97f8b0dce564f21 (diff) | |
download | rneovim-1bced9bf94f2767ad5bb91cc902cd58fc126055e.tar.gz rneovim-1bced9bf94f2767ad5bb91cc902cd58fc126055e.tar.bz2 rneovim-1bced9bf94f2767ad5bb91cc902cd58fc126055e.zip |
vim-patch:8.2.4074: going over the end of NameBuff
Problem: Going over the end of NameBuff.
Solution: Check length when appending a space.
https://github.com/vim/vim/commit/de05bb25733c3319e18dca44e9b59c6ee389eb26
Diffstat (limited to 'src/nvim/statusline.c')
-rw-r--r-- | src/nvim/statusline.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index 665a72b083..33c5c3a347 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -80,10 +80,11 @@ void win_redr_status(win_T *wp) p = (char_u *)NameBuff; len = (int)STRLEN(p); - if (bt_help(wp->w_buffer) - || wp->w_p_pvw - || bufIsChanged(wp->w_buffer) - || wp->w_buffer->b_p_ro) { + if ((bt_help(wp->w_buffer) + || wp->w_p_pvw + || bufIsChanged(wp->w_buffer) + || wp->w_buffer->b_p_ro) + && len < MAXPATHL - 1) { *(p + len++) = ' '; } if (bt_help(wp->w_buffer)) { |