1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Quick extra: make sure parsed tracks don't overflow the 6400 byte space available in an MFM disk. Which might be better expressed as 6250?

This commit is contained in:
Thomas Harte 2016-12-31 12:51:52 -05:00
parent cfbab1448c
commit 52b850a3f5

View File

@ -139,5 +139,6 @@ void OricMFMDSK::store_updated_track_at_position(unsigned int head, unsigned int
std::lock_guard<std::mutex> lock_guard(file_access_mutex); std::lock_guard<std::mutex> lock_guard(file_access_mutex);
fseek(file_, file_offset, SEEK_SET); fseek(file_, file_offset, SEEK_SET);
fwrite(parsed_track.data(), 1, parsed_track.size(), file_); size_t track_size = std::min((size_t)6400, parsed_track.size());
fwrite(parsed_track.data(), 1, track_size, file_);
} }