We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41b8fc2 commit 1fecea8Copy full SHA for 1fecea8
lib/meatloaf/disk/d64.cpp
@@ -382,6 +382,9 @@ uint16_t D64MStream::readFile(uint8_t *buf, uint16_t size)
382
383
if (size > 0)
384
{
385
+ // Only read up to the bytes remaining in this sector
386
+ size = std::min(size, (uint16_t) (block_size - sector_offset % block_size));
387
+
388
bytesRead += readContainer(buf, size);
389
sector_offset += bytesRead;
390
0 commit comments