Patch 9.0.0384 (after 9.0.0374)
Problem: Covertity still complains about using return value of getc().
Solution: Check for EOF.
Files: src/spellfile.c
*** ../vim-9.0.0383/src/spellfile.c 2022-09-05 10:55:23.580090284 +0100
--- src/spellfile.c 2022-09-05 11:02:22.855929518 +0100
***************
*** 846,852 ****
if (len > MAXREGIONS * 2)
return SP_FORMERROR;
for (i = 0; i < len; ++i)
! lp->sl_regions[i] = c = getc(fd); // <regionname>
lp->sl_regions[len] = NUL;
return c == EOF ? SP_TRUNCERROR : 0;
}
--- 846,852 ----
if (len > MAXREGIONS * 2)
return SP_FORMERROR;
for (i = 0; i < len; ++i)
! lp->sl_regions[i] = (c = getc(fd)) == EOF ? 0 : c; // <regionname>
lp->sl_regions[len] = NUL;
return c == EOF ? SP_TRUNCERROR : 0;
}
***************
*** 927,933 ****
buf[0] = '^'; // always match at one position only
p = buf + 1;
while (n-- > 0)
! *p++ = c = getc(fd); // <condstr>
if (c == EOF)
break;
*p = NUL;
--- 927,933 ----
buf[0] = '^'; // always match at one position only
p = buf + 1;
while (n-- > 0)
! *p++ = (c = getc(fd)) == EOF ? 0 : c; // <condstr>
if (c == EOF)
break;
*p = NUL;
***************
*** 1067,1073 ****
// 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++ = NUL;
// <saltolen> <salto>
--- 1067,1073 ----
// store the char we got while checking for end of sm_lead
*p++ = c;
for (++i; i < ccnt; ++i)
! *p++ = (c = getc(fd)) == EOF ? 0 : c; // <salfrom>
*p++ = NUL;
// <saltolen> <salto>
*** ../vim-9.0.0383/src/version.c 2022-09-05 10:55:23.580090284 +0100
--- src/version.c 2022-09-05 11:03:54.335894443 +0100
***************
*** 705,706 ****
--- 705,708 ----
{ /* Add new patch number below this line */
+ /**/
+ 384,
/**/
--
hundred-and-one symptoms of being an internet addict:
3. Your bookmark takes 15 minutes to scroll from top to bottom.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///