Fix save data off-by-one error

This commit is contained in:
Alex Barney 2018-12-10 16:22:51 -06:00
parent fa91eea11d
commit 4a65a5da20

View file

@ -17,7 +17,9 @@ namespace LibHac.IO.Save
Header = new AllocationTableHeader(HeaderStorage); Header = new AllocationTableHeader(HeaderStorage);
Stream tableStream = storage.AsStream(); Stream tableStream = storage.AsStream();
int blockCount = (int)(Header.AllocationTableBlockCount);
// The first entry in the table is reserved. Block 0 is at table index 1
int blockCount = (int)(Header.AllocationTableBlockCount) + 1;
Entries = new AllocationTableEntry[blockCount]; Entries = new AllocationTableEntry[blockCount];
tableStream.Position = 0; tableStream.Position = 0;