]> granicus.if.org Git - vim/commitdiff
patch 9.0.0384: Covertity still complains about using return value of getc() v9.0.0384
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Sep 2022 10:04:14 +0000 (11:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Sep 2022 10:04:14 +0000 (11:04 +0100)
Problem:    Covertity still complains about using return value of getc().
Solution:   Check for EOF.

src/spellfile.c
src/version.c

index b248b07ee49c1e9e0054f55a94b4dfc34ff8da44..3c934fcfa54947eb538407fd29ddfa1b89abd2c6 100644 (file)
@@ -846,7 +846,7 @@ read_region_section(FILE *fd, slang_T *lp, int len)
     if (len > MAXREGIONS * 2)
        return SP_FORMERROR;
     for (i = 0; i < len; ++i)
-       lp->sl_regions[i] = c = getc(fd);       // <regionname>
+       lp->sl_regions[i] = (c = getc(fd)) == EOF ? 0 : c; // <regionname>
     lp->sl_regions[len] = NUL;
     return c == EOF ? SP_TRUNCERROR : 0;
 }
@@ -927,7 +927,7 @@ read_prefcond_section(FILE *fd, slang_T *lp)
            buf[0] = '^';           // always match at one position only
            p = buf + 1;
            while (n-- > 0)
-               *p++ = c = getc(fd);                // <condstr>
+               *p++ = (c = getc(fd)) == EOF ? 0 : c;       // <condstr>
            if (c == EOF)
                break;
            *p = NUL;
@@ -1067,7 +1067,7 @@ read_sal_section(FILE *fd, slang_T *slang)
            // store the char we got while checking for end of sm_lead
            *p++ = c;
        for (++i; i < ccnt; ++i)
-           *p++ = c = getc(fd);                // <salfrom>
+           *p++ = (c = getc(fd)) == EOF ? 0 : c;       // <salfrom>
        *p++ = NUL;
 
        // <saltolen> <salto>
index 767fdc5806bc99241506b7f4a6eafa688b2125ae..181417f14cc1b0e7097aecb3ac747b6b133752c4 100644 (file)
@@ -703,6 +703,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    384,
 /**/
     383,
 /**/