From f410dcb3f3312ed328b01dd9d27c5385f54b89ad Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 12 May 2018 18:05:33 -0400 Subject: [PATCH] Ensures proper test: not having a number of sectors that is a multiple of the track count. --- Storage/Disk/DiskImage/Formats/AppleDSK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Storage/Disk/DiskImage/Formats/AppleDSK.cpp b/Storage/Disk/DiskImage/Formats/AppleDSK.cpp index 45cc45131..8461e9ec0 100644 --- a/Storage/Disk/DiskImage/Formats/AppleDSK.cpp +++ b/Storage/Disk/DiskImage/Formats/AppleDSK.cpp @@ -20,7 +20,7 @@ namespace { AppleDSK::AppleDSK(const std::string &file_name) : file_(file_name) { - if(file_.stats().st_size % number_of_tracks*bytes_per_sector) throw Error::InvalidFormat; + if(file_.stats().st_size % (number_of_tracks*bytes_per_sector)) throw Error::InvalidFormat; sectors_per_track_ = static_cast(file_.stats().st_size / (number_of_tracks*bytes_per_sector)); if(sectors_per_track_ != 13 && sectors_per_track_ != 16) throw Error::InvalidFormat;