Fix fragmentation handling

This commit is contained in:
Phillip Stephens 2016-06-26 03:36:29 -07:00
parent e7b47d7a41
commit fe835efd71
1 changed files with 2 additions and 2 deletions

View File

@ -105,11 +105,11 @@ void Card::write(FileHandle* f, const void* buf, size_t size)
f->file->m_modifiedTime = getGCTime();
if (f->blockOffset > BlockSize)
{
f->curBlock = m_currentBat->m_map[f->curBlock - FSTBlocks];
f->blockOffset = 0;
/* TODO: Add error */
if (f->curBlock == 0xFFFF)
return;
f->curBlock = m_currentBat->m_map[f->curBlock];
}
size_t blockOffset = (f->curBlock * BlockSize) + f->offset;
fseek(mc, blockOffset, SEEK_SET);