diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-10 11:26:33 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-10 11:26:33 +0000 |
commit | b06cfcf5a3b0248527fd70f9323272aa96db2f56 (patch) | |
tree | 6debd5f4097e23b811eac1294875eceb70454c51 | |
parent | dc4451df61a6aa12a0661817b7094fb32f09e11d (diff) |
patch 8.2.4051: compiler complains about possibly uninitialized variablev8.2.4051
Problem: Compiler complains about possibly uninitialized variable.
Solution: Add code to avoid a compiler warning. (John Marriott)
-rw-r--r-- | src/scriptfile.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index c1ab41503f..7680fd505f 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -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) { @@ -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; } diff --git a/src/version.c b/src/version.c index a2ce58e4b4..f3213eeabc 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4051, +/**/ 4050, /**/ 4049, |