From 0c96e1025410a852b3e326d7e7befd9d85a6781c Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Sat, 12 Aug 2017 15:51:48 -0400 Subject: [PATCH] SIM_CARD: Fixed bug in handling of binary decks with one card. --- sim_card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim_card.c b/sim_card.c index 128cca2..2191637 100644 --- a/sim_card.c +++ b/sim_card.c @@ -736,7 +736,7 @@ sim_read_card(UNIT * uptr) data->image[col++] |= c; } - if (col >= 80 && (data->cbuff[i] & 0x80) == 0) { + if (i < data->len && col >= 80 && (data->cbuff[i] & 0x80) == 0) { r = SCPE_IOERR; } /* Record over length of card, skip until next */ @@ -772,7 +772,7 @@ sim_read_card(UNIT * uptr) data->image[col++] = sim_bcd_to_hol(c); } - if (col >= 80 && (data->cbuff[i] & 0x80) == 0) { + if (i < data->len && col >= 80 && (data->cbuff[i] & 0x80) == 0) { r = SCPE_IOERR; }