Merge pull request #7582 from AdmiralCurtiss/memcard-delete-wrong-dir

GCMemcard: Fix incorrect directory block being accessed in RemoveFile().
This commit is contained in:
Pierre Bourdon 2018-11-22 06:43:25 +01:00 committed by GitHub
commit 0c6d677233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -739,8 +739,8 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
if (index >= DIRLEN)
return DELETE_FAIL;
u16 startingblock = BE16(dir.Dir[index].FirstBlock);
u16 numberofblocks = BE16(dir.Dir[index].BlockCount);
u16 startingblock = BE16(CurrentDir->Dir[index].FirstBlock);
u16 numberofblocks = BE16(CurrentDir->Dir[index].BlockCount);
BlockAlloc UpdatedBat = *CurrentBat;
if (!UpdatedBat.ClearBlocks(startingblock, numberofblocks))