1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Ensures proper test: not having a number of sectors that is a multiple of the track count.

This commit is contained in:
Thomas Harte 2018-05-12 18:05:33 -04:00
parent bd27f61a03
commit f410dcb3f3

View File

@ -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<int>(file_.stats().st_size / (number_of_tracks*bytes_per_sector));
if(sectors_per_track_ != 13 && sectors_per_track_ != 16) throw Error::InvalidFormat;