mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
vim-patch:8.2.1089: Coverity warns for pointer computation
Problem: Coverity warns for pointer computation.
Solution: Avoid computing a pointer to invalid memory.
927b7dd0fe
This commit is contained in:
parent
e84c075ad9
commit
9f73715daa
@ -5095,7 +5095,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 = xmalloc(MAXPATHL);
|
||||
@ -5105,12 +5106,10 @@ mkspell (
|
||||
if (fcount == 1 && len > 4 && STRCMP(fnames[0] + len - 4, ".add") == 0) {
|
||||
// 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());
|
||||
|
Loading…
Reference in New Issue
Block a user