Patch 9.0.0374 (after 9.0.0367)
Problem: Coverity still complains about dropping sign of character.
Solution: Add intermediate variable.
Files: src/spellfile.c
*** ../vim-9.0.0373/src/spellfile.c 2022-09-03 12:53:17.223026199 +0100
--- src/spellfile.c 2022-09-04 11:51:10.598778253 +0100
***************
*** 404,410 ****
* <HEADER>: <fileID>
*/
for (i = 0; i < VIMSPELLMAGICL; ++i)
! buf[i] = (unsigned)getc(fd); // <fileID>
if (STRNCMP(buf, VIMSPELLMAGIC, VIMSPELLMAGICL) != 0)
{
emsg(_(e_this_does_not_look_like_spell_file));
--- 404,410 ----
* <HEADER>: <fileID>
*/
for (i = 0; i < VIMSPELLMAGICL; ++i)
! buf[i] = c = getc(fd); // <fileID>
if (STRNCMP(buf, VIMSPELLMAGIC, VIMSPELLMAGICL) != 0)
{
emsg(_(e_this_does_not_look_like_spell_file));
***************
*** 700,706 ****
* <SUGHEADER>: <fileID> <versionnr> <timestamp>
*/
for (i = 0; i < VIMSUGMAGICL; ++i)
! buf[i] = (unsigned)getc(fd); // <fileID>
if (STRNCMP(buf, VIMSUGMAGIC, VIMSUGMAGICL) != 0)
{
semsg(_(e_this_does_not_look_like_sug_file_str),
--- 700,706 ----
* <SUGHEADER>: <fileID> <versionnr> <timestamp>
*/
for (i = 0; i < VIMSUGMAGICL; ++i)
! buf[i] = c = getc(fd); // <fileID>
if (STRNCMP(buf, VIMSUGMAGIC, VIMSUGMAGICL) != 0)
{
semsg(_(e_this_does_not_look_like_sug_file_str),
***************
*** 841,853 ****
read_region_section(FILE *fd, slang_T *lp, int len)
{
int i;
if (len > MAXREGIONS * 2)
return SP_FORMERROR;
for (i = 0; i < len; ++i)
! lp->sl_regions[i] = (unsigned)getc(fd); // <regionname>
lp->sl_regions[len] = NUL;
! return 0;
}
/*
--- 841,854 ----
read_region_section(FILE *fd, slang_T *lp, int len)
{
int i;
+ int c;
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;
}
/*
***************
*** 898,903 ****
--- 899,905 ----
int cnt;
int i;
int n;
+ int c;
char_u *p;
char_u buf[MAXWLEN + 1];
***************
*** 925,931 ****
buf[0] = '^'; // always match at one position only
p = buf + 1;
while (n-- > 0)
! *p++ = (unsigned)getc(fd); // <condstr>
*p = NUL;
lp->sl_prefprog[i] = vim_regcomp(buf, RE_MAGIC + RE_STRING);
}
--- 927,935 ----
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;
lp->sl_prefprog[i] = vim_regcomp(buf, RE_MAGIC + RE_STRING);
}
***************
*** 1063,1069 ****
// store the char we got while checking for end of sm_lead
*p++ = c;
for (++i; i < ccnt; ++i)
! *p++ = (unsigned)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); // <salfrom>
*p++ = NUL;
// <saltolen> <salto>
*** ../vim-9.0.0373/src/version.c 2022-09-04 11:42:18.111231191 +0100
--- src/version.c 2022-09-04 11:54:34.398925915 +0100
***************
*** 709,710 ****
--- 709,712 ----
{ /* Add new patch number below this line */
+ /**/
+ 374,
/**/
--
Engineers understand that their appearance only bothers other people and
therefore it is not worth optimizing.
(Scott Adams - The Dilbert principle)
/// 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 ///