Fixed the second batch of problems

This commit is contained in:
OBattler
2020-01-15 03:48:33 +01:00
parent fab0a368f1
commit af023ff5dd
14 changed files with 123 additions and 64 deletions

View File

@@ -262,7 +262,8 @@ state_data_read(td0dsk_t *state, uint8_t *buf, uint16_t size)
size = (image_size - state->fdd_file_offset) & 0xffff;
if (fseek(state->fdd_file, state->fdd_file_offset, SEEK_SET) == -1)
fatal("TD0: Failed to seek in state_data_read()\n");
fread(buf, 1, size, state->fdd_file);
if (fread(buf, 1, size, state->fdd_file) != size)
fatal("TD0: Error reading data in state_data_read()\n");
state->fdd_file_offset += size;
return(size);