Skip to content

Commit

Permalink
Merge pull request #1685 from MessagePack-CSharp/fix1586
Browse files Browse the repository at this point in the history
Remove `long` to `int` truncation of stream position
  • Loading branch information
AArnott committed Sep 28, 2023
2 parents ec99ca7 + e9100a7 commit 6edce56
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -440,7 +440,7 @@ private static T DeserializeFromSequenceAndRewindStreamIfPossible<T>(Stream stre
if (streamToRewind.CanSeek && !reader.End)
{
// Reverse the stream as many bytes as we left unread.
int bytesNotRead = checked((int)reader.Sequence.Slice(reader.Position).Length);
long bytesNotRead = reader.Sequence.Slice(reader.Position).Length;
streamToRewind.Seek(-bytesNotRead, SeekOrigin.Current);
}

Expand Down

0 comments on commit 6edce56

Please sign in to comment.