coverity/331382: Allocate enough space for trailing NUL

This commit is contained in:
James McCoy
2021-05-05 23:47:32 -04:00
parent f6d4226f4d
commit 9bdbac6712

View File

@@ -131,7 +131,7 @@ static int msg_grid_scroll_discount = 0;
static void ui_ext_msg_set_pos(int row, bool scrolled)
{
char buf[MAX_MCO];
char buf[MAX_MCO + 1];
size_t size = utf_char2bytes(curwin->w_p_fcs_chars.msgsep, (char_u *)buf);
buf[size] = '\0';
ui_call_msg_set_pos(msg_grid.handle, row, scrolled,