diff --git a/torrent.go b/torrent.go index 3bbbcef8..00d5ac07 100644 --- a/torrent.go +++ b/torrent.go @@ -655,7 +655,7 @@ type Peer struct { } func (t *torrent) pieceLength(piece int) (len_ pp.Integer) { - if piece < 0 || piece > t.Info.NumPieces() { + if piece < 0 || piece >= t.Info.NumPieces() { return } if int(piece) == t.numPieces()-1 {