From 6a9a729674e1683566672b264ccef4b6dcd7bd93 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 27 Apr 2019 00:01:26 -0400 Subject: vim-patch:8.1.1209: clever compiler warns for buffer being too small Problem: Clever compiler warns for buffer being too small. Solution: Make the buffer bigger (even though it's not really needed). https://github.com/vim/vim/commit/5431589d25e73892fcf7ad1eaca53f742c1c9303 --- src/nvim/eval.c | 4 ++-- src/nvim/syntax.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 10d6bbf714..c7d4e32739 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10117,7 +10117,7 @@ static void f_getmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) // match added with matchaddpos() for (i = 0; i < MAXPOSMATCH; i++) { llpos_T *llpos; - char buf[6]; + char buf[30]; // use 30 to avoid compiler warning llpos = &cur->pos.pos[i]; if (llpos->lnum == 0) { @@ -14946,7 +14946,7 @@ static void f_setmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) // match from matchaddpos() for (i = 1; i < 9; i++) { - char buf[5]; + char buf[30]; // use 30 to avoid compiler warning snprintf(buf, sizeof(buf), "pos%d", i); dictitem_T *const pos_di = tv_dict_find(d, buf, -1); if (pos_di != NULL) { diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index ed95cdbebb..1b30161e94 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -7460,7 +7460,7 @@ void highlight_attr_set_all(void) void highlight_changed(void) { int id; - char_u userhl[10]; + char_u userhl[30]; // use 30 to avoid compiler warning int id_SNC = -1; int id_S = -1; int hlcnt; -- cgit