diff --git a/src/LibHac/IO/NxFileStream.cs b/src/LibHac/IO/NxFileStream.cs index 895996a0..c0e10a2c 100644 --- a/src/LibHac/IO/NxFileStream.cs +++ b/src/LibHac/IO/NxFileStream.cs @@ -18,7 +18,7 @@ namespace LibHac.IO public override int Read(byte[] buffer, int offset, int count) { int toRead = (int)Math.Min(count, Length - Position); - BaseFile.Read(buffer.AsSpan(offset, count), Position); + BaseFile.Read(buffer.AsSpan(offset, toRead), Position); Position += toRead; return toRead; diff --git a/src/LibHac/IO/StorageStream.cs b/src/LibHac/IO/StorageStream.cs index 7cd63045..c67fc152 100644 --- a/src/LibHac/IO/StorageStream.cs +++ b/src/LibHac/IO/StorageStream.cs @@ -21,7 +21,7 @@ namespace LibHac.IO public override int Read(byte[] buffer, int offset, int count) { int toRead = (int) Math.Min(count, Length - Position); - BaseStorage.Read(buffer.AsSpan(offset, count), Position); + BaseStorage.Read(buffer.AsSpan(offset, toRead), Position); Position += toRead; return toRead;