mirror of
https://github.com/pevans/erc-c.git
synced 2024-12-22 14:30:45 +00:00
Add better handling if selected_drive is NULL
(Discovered from static analysis)
This commit is contained in:
parent
0dce7dbc58
commit
fa5bfe09ae
@ -419,7 +419,9 @@ apple2_dd_switch_drive(apple2 *mach, size_t addr)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x9:
|
case 0x9:
|
||||||
|
if (mach->selected_drive) {
|
||||||
apple2_dd_turn_on(mach->selected_drive, true);
|
apple2_dd_turn_on(mach->selected_drive, true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xA:
|
case 0xA:
|
||||||
@ -431,11 +433,15 @@ apple2_dd_switch_drive(apple2 *mach, size_t addr)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xE:
|
case 0xE:
|
||||||
|
if (mach->selected_drive) {
|
||||||
mach->selected_drive->mode = DD_READ;
|
mach->selected_drive->mode = DD_READ;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xF:
|
case 0xF:
|
||||||
|
if (mach->selected_drive) {
|
||||||
mach->selected_drive->mode = DD_WRITE;
|
mach->selected_drive->mode = DD_WRITE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user