1
0
forked from aniani/vim

patch 8.2.0394: Coverity complains about using NULL pointer

Problem:    Coverity complains about using NULL pointer.
Solution:   Use empty string when option value is NULL.
This commit is contained in:
Bram Moolenaar
2020-03-16 20:27:38 +01:00
parent c030063329
commit 7f009dfa06
2 changed files with 3 additions and 1 deletions

View File

@@ -500,7 +500,7 @@ set_string_option(
if (is_hidden_option(opt_idx)) // don't set hidden option if (is_hidden_option(opt_idx)) // don't set hidden option
return NULL; return NULL;
s = vim_strsave(value); s = vim_strsave(value == NULL ? (char_u *)"" : value);
if (s != NULL) if (s != NULL)
{ {
varp = (char_u **)get_option_varp_scope(opt_idx, varp = (char_u **)get_option_varp_scope(opt_idx,

View File

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