diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-05 11:04:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-05 11:04:14 +0100 |
commit | c7d2ff2ca03f1f36544a92cb93300eae06bcd0c0 (patch) | |
tree | 49be2a5b11912e8167bef504feec5707ee134127 | |
parent | 963ab26842be22c0d210c3e950fecac28578f8be (diff) | |
download | vim-git-c7d2ff2ca03f1f36544a92cb93300eae06bcd0c0.tar.gz |
patch 9.0.0384: Covertity still complains about using return value of getc()v9.0.0384
Problem: Covertity still complains about using return value of getc().
Solution: Check for EOF.
-rw-r--r-- | src/spellfile.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/spellfile.c b/src/spellfile.c index b248b07ee..3c934fcfa 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -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> diff --git a/src/version.c b/src/version.c index 767fdc580..181417f14 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 384, +/**/ 383, /**/ 382, |