0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0510: Coverity complains about using uninitialized variable

Problem:    Coverity complains about using uninitialized variable.
Solution:   Assign a value to "scol".  Move code inside NULL check.
This commit is contained in:
Bram Moolenaar
2020-04-04 14:50:32 +02:00
parent cde0ff39da
commit 8d4ed11da6
3 changed files with 14 additions and 10 deletions

View File

@@ -110,6 +110,8 @@ find_word_under_cursor(
lbuf = vim_strnsave(lbuf, len);
}
}
else
scol = col;
if (winp != NULL)
*winp = wp;

View File

@@ -798,16 +798,16 @@ apply_general_options(win_T *wp, dict_T *dict)
if (*str != NUL)
wp->w_border_char[i] = mb_ptr2char(str);
}
}
if (list->lv_len == 1)
for (i = 1; i < 8; ++i)
wp->w_border_char[i] = wp->w_border_char[0];
if (list->lv_len == 2)
{
for (i = 4; i < 8; ++i)
wp->w_border_char[i] = wp->w_border_char[1];
for (i = 1; i < 4; ++i)
wp->w_border_char[i] = wp->w_border_char[0];
if (list->lv_len == 1)
for (i = 1; i < 8; ++i)
wp->w_border_char[i] = wp->w_border_char[0];
if (list->lv_len == 2)
{
for (i = 4; i < 8; ++i)
wp->w_border_char[i] = wp->w_border_char[1];
for (i = 1; i < 4; ++i)
wp->w_border_char[i] = wp->w_border_char[0];
}
}
}
}

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
510,
/**/
509,
/**/