I1401, I1620, I7094: Address Coverity issues in card reader devices

This commit is contained in:
Mark Pizzolato 2022-03-15 07:25:34 -07:00
parent 86f65093bc
commit d02e91c797
3 changed files with 7 additions and 7 deletions

View file

@ -423,9 +423,9 @@ if (ferror (cdr_unit.fileref)) { /* error? */
}
cdr_unit.pos = ftell (cdr_unit.fileref); /* update position */
if (ssa) { /* if last cd on */
getc (cdr_unit.fileref); /* see if more */
if (feof (cdr_unit.fileref)) /* eof? set flag */
ind[IN_LST] = 1;
if (getc (cdr_unit.fileref) == EOF) /* eof? */
ind[IN_LST] = 1; /* set flag */
clearerr (cdr_unit.fileref);
fseek (cdr_unit.fileref, cdr_unit.pos, SEEK_SET);
}
return SCPE_OK;

View file

@ -371,9 +371,9 @@ if ((i = strlen (cdr_buf)) > 0) { /* anything at all? */
}
}
cdr_unit.pos = ftell (cdr_unit.fileref); /* update position */
getc (cdr_unit.fileref); /* see if more */
if (feof (cdr_unit.fileref)) /* eof? set last */
ind[IN_LAST] = 1;
if (getc (cdr_unit.fileref) == EOF) /* eof? */
ind[IN_LST] = 1; /* set flag */
clearerr (cdr_unit.fileref);
fseek (cdr_unit.fileref, cdr_unit.pos, SEEK_SET); /* "backspace" */
return SCPE_OK;
}

View file

@ -201,7 +201,7 @@ return SCPE_OK;
t_stat cdr_svc (UNIT *uptr)
{
uint32 i, col, row, bufw, colbin;
char cdr_cbuf[(2 * CD_CHRLNT) + 2];
char cdr_cbuf[(2 * CD_CHRLNT) + 2 + 1];
t_uint64 dat = 0;
if ((uptr->flags & UNIT_ATT) == 0) /* not attached? */