Skip to content

Commit

Permalink
patch 8.2.4051: compiler complains about possibly uninitialized variable
Browse files Browse the repository at this point in the history
Problem:    Compiler complains about possibly uninitialized variable.
Solution:   Add code to avoid a compiler warning. (John Marriott)
  • Loading branch information
brammool committed Jan 10, 2022
1 parent dc4451d commit b06cfcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scriptfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ get_new_scriptitem(int *error)
{
static scid_T last_current_SID = 0;
int sid = ++last_current_SID;
scriptitem_T *si;
scriptitem_T *si = NULL;

if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL)
{
Expand Down Expand Up @@ -305,8 +305,10 @@ get_new_scriptitem(int *error)
# endif
}

// Used to check script variable index is still valid.
si->sn_script_seq = current_sctx.sc_seq;
// "si" can't be NULL, check only to avoid a compiler warning
if (si != NULL)
// Used to check script variable index is still valid.
si->sn_script_seq = current_sctx.sc_seq;

return sid;
}
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4051,
/**/
4050,
/**/
Expand Down

0 comments on commit b06cfcf

Please sign in to comment.