fix off-by-one in r2488 reported by BentMyWookie. Hooray for assert()!

This commit is contained in:
Charles Kerr 2007-07-25 02:28:25 +00:00
parent 730d6df742
commit 95313e077a
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ tr_torrentInitFilePieces( tr_torrent_t * tor )
uint64_t lastByte;
int lastBlock;
if( i == (tor->info.pieceCount-1))
lastByte = tor->info.totalSize;
lastByte = tor->info.totalSize - 1;
else {
lastByte = i + 1;
lastByte *= tor->info.pieceSize;