fix r2531 bug reported by Lacrocivious
This commit is contained in:
parent
29367fda62
commit
530507760b
|
@ -219,8 +219,14 @@ torrentRealInit( tr_handle_t * h,
|
|||
|
||||
tor->lastPieceSize = info->totalSize % info->pieceSize;
|
||||
|
||||
if( !tor->lastPieceSize )
|
||||
tor->lastPieceSize = info->pieceSize;
|
||||
|
||||
tor->lastBlockSize = info->totalSize % tor->blockSize;
|
||||
|
||||
if( !tor->lastBlockSize )
|
||||
tor->lastBlockSize = tor->blockSize;
|
||||
|
||||
tor->blockCount =
|
||||
( info->totalSize + tor->blockSize - 1 ) / tor->blockSize;
|
||||
|
||||
|
@ -231,7 +237,6 @@ torrentRealInit( tr_handle_t * h,
|
|||
( tor->lastPieceSize + tor->blockSize - 1 ) / tor->blockSize;
|
||||
|
||||
/* check our work */
|
||||
fprintf( stderr, "adding torrent [%s]\n", tor->info.name );
|
||||
assert( ( info->pieceSize % tor->blockSize ) == 0 );
|
||||
t = info->pieceCount - 1;
|
||||
t *= info->pieceSize;
|
||||
|
|
Loading…
Reference in New Issue