SCP: Fix sim_disk to avoid potential reference to uninitialized context structure. Fix #194

This commit is contained in:
Mark Pizzolato 2015-03-19 13:52:33 -07:00
parent 89a3783281
commit 46d7bfc660
2 changed files with 1 additions and 2 deletions

Binary file not shown.

View file

@ -366,12 +366,11 @@ return SCPE_OK;
t_stat sim_disk_show_capac (FILE *st, UNIT *uptr, int32 val, void *desc)
{
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
const char *cap_units = "B";
DEVICE *dptr = find_dev_from_unit (uptr);
t_offset capac = ((t_offset)uptr->capac)*((dptr->flags & DEV_SECTORS) ? 512 : 1);
if (ctx->capac_factor == 2)
if ((dptr->dwidth / dptr->aincr) == 16)
cap_units = "W";
if (capac) {
if (capac >= (t_offset) 1000000)