mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
coverity/13709: spell_add_word: handle failed fseek()
Check the return status after removing a duplicate word. Add a log for a nonzero return status.
This commit is contained in:

committed by
Justin M. Keyes

parent
32df42549a
commit
aea70b4404
@@ -5368,8 +5368,9 @@ spell_add_word (
|
||||
// doesn't work for all systems, close the file first.
|
||||
fclose(fd);
|
||||
fd = mch_fopen((char *)fname, "r+");
|
||||
if (fd == NULL)
|
||||
if (fd == NULL) {
|
||||
break;
|
||||
}
|
||||
if (fseek(fd, fpos, SEEK_SET) == 0) {
|
||||
fputc('#', fd);
|
||||
if (undo) {
|
||||
@@ -5378,7 +5379,9 @@ spell_add_word (
|
||||
len, word, NameBuff);
|
||||
}
|
||||
}
|
||||
fseek(fd, fpos_next, SEEK_SET);
|
||||
if (fseek(fd, fpos_next, SEEK_SET) <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fd != NULL)
|
||||
|
Reference in New Issue
Block a user