1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-25 03:44:58 +00:00

Intel-Systems: Cleanup Coverity identified issues and address range issues

This commit is contained in:
Bill Beech
2019-10-31 14:53:14 -07:00
parent 82d897712c
commit 58c5fe417f
28 changed files with 451 additions and 606 deletions

View File

@@ -135,14 +135,16 @@ uint8 EPROM_get_mbyte(uint16 addr)
{
uint8 val;
if ((addr >= EPROM_unit.u3) && ((uint32) addr <= (EPROM_unit.u3 + EPROM_unit.capac))) {
if ((addr >= EPROM_unit.u3) && ((uint16) addr <= (EPROM_unit.u3 + EPROM_unit.capac))) {
SET_XACK(1); /* good memory address */
val = *((uint8 *)EPROM_unit.filebuf + (addr - EPROM_unit.u3));
val &= 0xFF;
return val;
} else {
SET_XACK(0); /* bad memory address */
sim_printf("EPROM: Out of range\n");
}
SET_XACK(0); /* bad memory address */
return 0;
}