diff src/spellfile.c @ 23841:ba4f8569ff8a v8.2.2462

patch 8.2.2462: Coverity warns for not checking for fseek() error Commit: https://github.com/vim/vim/commit/2c363a2e95ee0b366e72063d093d20e025ef4a66 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 3 20:14:23 2021 +0100 patch 8.2.2462: Coverity warns for not checking for fseek() error Problem: Coverity warns for not checking for fseek() error. Solution: Give an error message if fseek() fails.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Feb 2021 20:15:04 +0100
parents f33de1c1eb4a
children 59cfa23bd9eb
line wrap: on
line diff
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -6277,7 +6277,11 @@ spell_add_word(
 							 len, word, NameBuff);
 			}
 		    }
-		    fseek(fd, fpos_next, SEEK_SET);
+		    if (fseek(fd, fpos_next, SEEK_SET) != 0)
+		    {
+			PERROR(_("Seek error in spellfile"));
+			break;
+		    }
 		}
 	    }
 	    if (fd != NULL)