swtp6800: Solve Coverity identified issues

This commit is contained in:
Bill Beech 2017-06-07 11:06:02 -07:00
parent c389573c91
commit 625d1b391e
2 changed files with 11 additions and 3 deletions

View file

@ -398,7 +398,11 @@ int32 fdcdrv(int32 io, int32 data)
sim_printf("\nfdccmd: File error\n");
return SCPE_IOERR;
}
sim_fread(dsk_unit[cur_dsk].filebuf, SECSIZ, 1, dsk_unit[cur_dsk].fileref); /* read in buffer */
err = sim_fread(dsk_unit[cur_dsk].filebuf, SECSIZ, 1, dsk_unit[cur_dsk].fileref); /* read in buffer */
if (err) {
sim_printf("\nfdccmd: File error\n");
return SCPE_IOERR;
}
dsk_unit[cur_dsk].u3 |= BUSY | DRQ; /* set DRQ & BUSY */
dsk_unit[cur_dsk].pos = 0; /* clear counter */
spt = *((uint8 *)(dsk_unit[cur_dsk].filebuf) + MAXSEC) & 0xFF;
@ -445,7 +449,11 @@ int32 fdccmd(int32 io, int32 data)
sim_printf("\nfdccmd: File error\n");
return SCPE_IOERR;
}
sim_fread(dsk_unit[cur_dsk].filebuf, SECSIZ, 1, dsk_unit[cur_dsk].fileref); /* read in buffer */
err = sim_fread(dsk_unit[cur_dsk].filebuf, SECSIZ, 1, dsk_unit[cur_dsk].fileref); /* read in buffer */
if (err) {
sim_printf("\nfdccmd: File error\n");
return SCPE_IOERR;
}
dsk_unit[cur_dsk].u3 |= BUSY | DRQ; /* set DRQ & BUSY */
dsk_unit[cur_dsk].pos = 0; /* clear counter */
break;

View file

@ -173,7 +173,7 @@ int32 get_base(void)
int32 CPU_BD_get_mbyte(int32 addr)
{
int32 val;
int32 val = 0;
sim_debug (DEBUG_read, &CPU_BD_dev, "CPU_BD_get_mbyte: addr=%04X\n", addr);
switch(addr & 0xF000) {