Skip to content

Commit

Permalink
Update EndianStreamReader.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VNNCC committed Nov 23, 2023
1 parent 356a3ea commit 33fd9b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Snowberry.IO/Reader/EndianStreamReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override void CopyTo(Stream destination, int length, int bufferSize = 0x1

byte[] buffer = new byte[bufferSize];
int read;
while (length > 0 && (read = Stream.Read(buffer, 0, bufferSize)) > 0)
while (length > 0 && (read = Stream.Read(buffer, 0, Math.Min(bufferSize, length))) > 0)
{
if (IsRegionViewEnabled)
_viewOffset += read;
Expand Down

0 comments on commit 33fd9b0

Please sign in to comment.