diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-29 22:24:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-29 22:24:56 +0200 |
commit | 927b7dd0fe9a0a82b39d600779edb4390ecdeda6 (patch) | |
tree | 7b8ff75cec2e4ba1e05c7f42582e254bb5fa64d7 | |
parent | 6378b21d6dd38cc0f80aa6d31d747db6c287483b (diff) | |
download | vim-git-927b7dd0fe9a0a82b39d600779edb4390ecdeda6.tar.gz |
patch 8.2.1089: Coverity warns for pointer computationv8.2.1089
Problem: Coverity warns for pointer computation.
Solution: Avoid computing a pointer to invalid memory.
-rw-r--r-- | src/spellfile.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/spellfile.c b/src/spellfile.c index d8cf3d484..fc365e2a0 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -5908,7 +5908,8 @@ mkspell( spin.si_newcompID = 127; // start compound ID at first maximum // default: fnames[0] is output file, following are input files - innames = &fnames[1]; + // When "fcount" is 1 there is only one file. + innames = &fnames[fcount == 1 ? 0 : 1]; incount = fcount - 1; wfname = alloc(MAXPATHL); @@ -5922,14 +5923,12 @@ mkspell( { // For ":mkspell path/en.latin1.add" output file is // "path/en.latin1.add.spl". - innames = &fnames[0]; incount = 1; vim_snprintf((char *)wfname, MAXPATHL, "%s.spl", fnames[0]); } else if (fcount == 1) { // For ":mkspell path/vim" output file is "path/vim.latin1.spl". - innames = &fnames[0]; incount = 1; vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL, fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc()); diff --git a/src/version.c b/src/version.c index 48ff321ca..fdf0504f0 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1089, +/**/ 1088, /**/ 1087, |