mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Fix RemapStream bug
This commit is contained in:
parent
83323b58c3
commit
2f00192cc7
1 changed files with 3 additions and 3 deletions
|
@ -53,14 +53,14 @@ namespace libhac.Savefile
|
||||||
if (remaining < count) count = (int)remaining;
|
if (remaining < count) count = (int)remaining;
|
||||||
|
|
||||||
var toOutput = count;
|
var toOutput = count;
|
||||||
int pos = 0;
|
int outPos = offset;
|
||||||
|
|
||||||
while (toOutput > 0)
|
while (toOutput > 0)
|
||||||
{
|
{
|
||||||
var remainInEntry = CurrentEntry.VirtualOffsetEnd - Position;
|
var remainInEntry = CurrentEntry.VirtualOffsetEnd - Position;
|
||||||
int toRead = (int)Math.Min(toOutput, remainInEntry);
|
int toRead = (int)Math.Min(toOutput, remainInEntry);
|
||||||
BaseStream.Read(buffer, pos, toRead);
|
BaseStream.Read(buffer, outPos, toRead);
|
||||||
pos += toRead;
|
outPos += toRead;
|
||||||
toOutput -= toRead;
|
toOutput -= toRead;
|
||||||
Position += toRead;
|
Position += toRead;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue