From d09e7ac1e82fcacc41dda2e2ed2a34eaebdb78c3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 30 Dec 2016 17:44:35 -0500 Subject: [PATCH] Made an attempt at reacting appropriately if the very first thing that looks like a sector doesn't pan out. --- Storage/Disk/Encodings/MFM.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Storage/Disk/Encodings/MFM.cpp b/Storage/Disk/Encodings/MFM.cpp index e8cf95179..c0086c071 100644 --- a/Storage/Disk/Encodings/MFM.cpp +++ b/Storage/Disk/Encodings/MFM.cpp @@ -406,7 +406,8 @@ std::shared_ptr Parser::get_next_sector() std::shared_ptr Parser::get_sector(uint8_t sector) { - std::shared_ptr first_sector = get_next_sector(); + std::shared_ptr first_sector; + while(!first_sector && index_count_ < 2) first_sector = get_next_sector(); if(!first_sector) return first_sector; if(first_sector->sector == sector) return first_sector;