diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-04-27 00:01:26 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-04-27 00:13:46 -0400 |
commit | 6a9a729674e1683566672b264ccef4b6dcd7bd93 (patch) | |
tree | 52f2c18439fb130fbb126bb430e1d002b35f1030 | |
parent | 66d86d8bdbe96fe7d8e7390d7348fa458a0421fa (diff) | |
download | rneovim-6a9a729674e1683566672b264ccef4b6dcd7bd93.tar.gz rneovim-6a9a729674e1683566672b264ccef4b6dcd7bd93.tar.bz2 rneovim-6a9a729674e1683566672b264ccef4b6dcd7bd93.zip |
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
-rw-r--r-- | src/nvim/eval.c | 4 | ||||
-rw-r--r-- | src/nvim/syntax.c | 2 |
2 files changed, 3 insertions, 3 deletions
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; |