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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user