Possibly it was only wrong on the last piece in rare circumstances.
b1 := b[:avail]
pi := int(pos / r.t.Info().PieceLength)
ip := r.t.Info().Piece(pi)
b1 := b[:avail]
pi := int(pos / r.t.Info().PieceLength)
ip := r.t.Info().Piece(pi)
- po := pos % ip.Length()
+ po := pos % r.t.Info().PieceLength
missinggo.LimitLen(&b1, ip.Length()-po)
n, err = r.t.readAt(b1, pos)
if n != 0 {
missinggo.LimitLen(&b1, ip.Length()-po)
n, err = r.t.readAt(b1, pos)
if n != 0 {