1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-10 20:34:47 +00:00

SIM_CARD: Fixed error with short record file.

This commit is contained in:
Richard Cornwell
2016-07-18 20:40:46 -04:00
parent 5a6529cf2b
commit 5c2a7e7564

View File

@@ -625,6 +625,7 @@ sim_read_card(UNIT * uptr)
break;
case '\n':
col = 80;
i--;
break;
case '~': /* End of file mark */
if (col == 0) {
@@ -653,10 +654,10 @@ sim_read_card(UNIT * uptr)
}
}
}
sim_debug(DEBUG_CARD, dptr, "-%d-", i);
/* Scan to end of line, ignore anything after last column */
while (data->cbuff[i] != '\n' && data->cbuff[i] != '\r') {
if (i > data->len)
break;
while (data->cbuff[i] != '\n' && data->cbuff[i] != '\r' && i < data->len) {
i++;
}
if (data->cbuff[i] == '\n')