SCP: Fix sim_disk to avoid potential reference to uninitialized context structure. Fix #194
This commit is contained in:
parent
89a3783281
commit
46d7bfc660
2 changed files with 1 additions and 2 deletions
BIN
doc/simh.doc
BIN
doc/simh.doc
Binary file not shown.
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue