mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Ensures proper test: not having a number of sectors that is a multiple of the track count.
This commit is contained in:
parent
bd27f61a03
commit
f410dcb3f3
@ -20,7 +20,7 @@ namespace {
|
|||||||
|
|
||||||
AppleDSK::AppleDSK(const std::string &file_name) :
|
AppleDSK::AppleDSK(const std::string &file_name) :
|
||||||
file_(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));
|
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;
|
if(sectors_per_track_ != 13 && sectors_per_track_ != 16) throw Error::InvalidFormat;
|
||||||
|
Loading…
Reference in New Issue
Block a user