mirror of
https://github.com/open-simh/simh.git
synced 2026-01-13 23:37:13 +00:00
SIM_CARD: Fixed issues caused by last commit to sim_card.c
This commit is contained in:
parent
1a1396d0ba
commit
a58849613b
@ -993,10 +993,7 @@ _sim_read_deck(UNIT * uptr, int eof)
|
||||
do {
|
||||
if (buf.len < 500 && !feof(uptr->fileref)) {
|
||||
l = sim_fread(&buf.buffer[buf.len], 1, 8192, uptr->fileref);
|
||||
if (l < 0)
|
||||
r = SCPE_OPENERR;
|
||||
else
|
||||
buf.len += l;
|
||||
buf.len += l;
|
||||
}
|
||||
|
||||
/* Allocate space for some more cards if needed */
|
||||
@ -1023,6 +1020,7 @@ _sim_read_deck(UNIT * uptr, int eof)
|
||||
j = buf.size;
|
||||
for(i = 0; i < l; i++, j++)
|
||||
buf.buffer[i] = buf.buffer[j];
|
||||
buf.buffer[i] = '\0';
|
||||
buf.len -= buf.size;
|
||||
} while (buf.len > 0 && r == SCPE_OK);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user