aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/statusline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c
index fe6892cc27..434d4c8a6f 100644
--- a/src/nvim/statusline.c
+++ b/src/nvim/statusline.c
@@ -103,7 +103,8 @@ void win_redr_status(win_T *wp)
|| bufIsChanged(wp->w_buffer)
|| wp->w_buffer->b_p_ro)
&& plen < MAXPATHL - 1) {
- *(p + plen++) = ' ';
+ *(p + plen++) = ' '; // replace NUL with space
+ *(p + plen) = NUL; // NUL terminate the string
}
if (bt_help(wp->w_buffer)) {
plen += snprintf(p + plen, MAXPATHL - (size_t)plen, "%s", _("[Help]"));