diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-13 17:49:10 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-15 12:48:29 +0100 |
commit | a09b7f2e2e248e967e100018944e65dfe781c84d (patch) | |
tree | e77a0e1d9f39e578d15af3a0b36c7a51d669a543 | |
parent | 40cf1a1e749ab825e99ed948bc463bd0d8fa495e (diff) | |
download | rneovim-a09b7f2e2e248e967e100018944e65dfe781c84d.tar.gz rneovim-a09b7f2e2e248e967e100018944e65dfe781c84d.tar.bz2 rneovim-a09b7f2e2e248e967e100018944e65dfe781c84d.zip |
Fix warnings: spell.c: spell_read_aff(): Uninitialized arg: RI.
Problem : Uninitialized argument value @ 4469.
Diagnostic : Real issue.
Rationale : Happens when a line contains a spell info item (NAME, HOME,
VERSION, AUTHOR, EMAIL, COPYRIGHT), which expect a second
item, but then the second item is not present.
Resolution : Add guard (item count > 1) to failing branch.
-rw-r--r-- | src/nvim/spell.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 1a173cb8df..a760691ad3 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -4466,7 +4466,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) || aff->af_pref.ht_used > 0) smsg((char_u *)_("FLAG after using flags in %s line %d: %s"), fname, lnum, items[1]); - } else if (spell_info_item(items[0])) { + } else if (spell_info_item(items[0]) && itemcnt > 1) { p = (char_u *)getroom(spin, (spin->si_info == NULL ? 0 : STRLEN(spin->si_info)) + STRLEN(items[0]) |