comparison src/drawscreen.c @ 27090:5e65d802bd52 v8.2.4074

patch 8.2.4074: going over the end of NameBuff Commit: https://github.com/vim/vim/commit/de05bb25733c3319e18dca44e9b59c6ee389eb26 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 13:08:14 2022 +0000 patch 8.2.4074: going over the end of NameBuff Problem: Going over the end of NameBuff. Solution: Check length when appending a space.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 14:15:06 +0100
parents 30abd8e55ee5
children 6d7fe3af5aa2
comparison
equal deleted inserted replaced
27089:6cd7cdcf0024 27090:5e65d802bd52
460 460
461 get_trans_bufname(wp->w_buffer); 461 get_trans_bufname(wp->w_buffer);
462 p = NameBuff; 462 p = NameBuff;
463 len = (int)STRLEN(p); 463 len = (int)STRLEN(p);
464 464
465 if (bt_help(wp->w_buffer) 465 if ((bt_help(wp->w_buffer)
466 #ifdef FEAT_QUICKFIX 466 #ifdef FEAT_QUICKFIX
467 || wp->w_p_pvw 467 || wp->w_p_pvw
468 #endif 468 #endif
469 || bufIsChanged(wp->w_buffer) 469 || bufIsChanged(wp->w_buffer)
470 || wp->w_buffer->b_p_ro) 470 || wp->w_buffer->b_p_ro)
471 && len < MAXPATHL - 1)
471 *(p + len++) = ' '; 472 *(p + len++) = ' ';
472 if (bt_help(wp->w_buffer)) 473 if (bt_help(wp->w_buffer))
473 { 474 {
474 vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]")); 475 vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]"));
475 len += (int)STRLEN(p + len); 476 len += (int)STRLEN(p + len);