]> granicus.if.org Git - vim/commitdiff
patch 8.2.2462: Coverity warns for not checking for fseek() error v8.2.2462
authorBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2021 19:14:23 +0000 (20:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2021 19:14:23 +0000 (20:14 +0100)
Problem:    Coverity warns for not checking for fseek() error.
Solution:   Give an error message if fseek() fails.

src/spellfile.c
src/version.c

index 869db7f3ff4ead69d119131a92e51ecdb8ab3380..20181695a2e38910898a171d30fab55f4eb40441 100644 (file)
@@ -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)
index 522eaa80d789388284abcbc2409be98a1f58582d..a7288f38524581e5f960e149269527e461f5bbef 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2462,
 /**/
     2461,
 /**/