From 1a770142bd92a5c0b11f33b12d47e0f43ea825ef Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 14 Jan 2020 21:00:45 +0100 Subject: [PATCH] And another one. --- src/disk/hdd_image.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/disk/hdd_image.c b/src/disk/hdd_image.c index b5d943fdd..21fdf00c6 100644 --- a/src/disk/hdd_image.c +++ b/src/disk/hdd_image.c @@ -834,7 +834,10 @@ hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count) memset(empty_sector, 0, 512); - fseeko64(hdd_images[id].file, ((uint64_t)(sector) << 9LL) + hdd_images[id].base, SEEK_SET); + if (fseeko64(hdd_images[id].file, ((uint64_t)(sector) << 9LL) + hdd_images[id].base, SEEK_SET) == -1) { + fatal("Hard disk image %i: Zero error during seek\n", id); + return; + } for (i = 0; i < count; i++) { if (feof(hdd_images[id].file))