(trunk libT) #4332 "countRange/countArray exception" -- fix bug in tr_cpMissingBytesInPiece()
This commit is contained in:
parent
35fb00fd9e
commit
42a49a6c70
|
@ -214,7 +214,7 @@ tr_cpMissingBytesInPiece( const tr_completion * cp, tr_piece_index_t piece )
|
||||||
size_t haveBytes = 0;
|
size_t haveBytes = 0;
|
||||||
tr_block_index_t f, l;
|
tr_block_index_t f, l;
|
||||||
tr_torGetPieceBlockRange( cp->tor, piece, &f, &l );
|
tr_torGetPieceBlockRange( cp->tor, piece, &f, &l );
|
||||||
haveBytes = tr_bitfieldCountRange( &cp->blockBitfield, f, l );
|
haveBytes = tr_bitfieldCountRange( &cp->blockBitfield, f, l+1 );
|
||||||
haveBytes *= cp->tor->blockSize;
|
haveBytes *= cp->tor->blockSize;
|
||||||
if( tr_bitfieldHas( &cp->blockBitfield, l ) )
|
if( tr_bitfieldHas( &cp->blockBitfield, l ) )
|
||||||
haveBytes += tr_torBlockCountBytes( cp->tor, l );
|
haveBytes += tr_torBlockCountBytes( cp->tor, l );
|
||||||
|
|
Loading…
Reference in New Issue