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.
This commit is contained in:
Eliseo Martínez 2014-11-13 17:49:10 +01:00
parent 40cf1a1e74
commit a09b7f2e2e

View File

@ -4466,7 +4466,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|| aff->af_pref.ht_used > 0) || aff->af_pref.ht_used > 0)
smsg((char_u *)_("FLAG after using flags in %s line %d: %s"), smsg((char_u *)_("FLAG after using flags in %s line %d: %s"),
fname, lnum, items[1]); 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, p = (char_u *)getroom(spin,
(spin->si_info == NULL ? 0 : STRLEN(spin->si_info)) (spin->si_info == NULL ? 0 : STRLEN(spin->si_info))
+ STRLEN(items[0]) + STRLEN(items[0])