diff --git a/gigaparsec.go b/gigaparsec.go index d96fed0..66cafb9 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -127,8 +127,8 @@ type State[In any] struct { func (s State[In]) Read(dst []In) (n uint64, next State[In], err error) { nread, err := s.r.ReadAt(dst, int64(s.pos)) - if n > 0 { - s.pos += uint64(n) + if nread > 0 { + s.pos += uint64(nread) } return uint64(nread), s, err }