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).
5431589d25
This commit is contained in:
Jan Edmund Lazo 2019-04-27 00:01:26 -04:00
parent 66d86d8bdb
commit 6a9a729674
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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;