(trunk libT) #4332 "countRange/countArray exception" -- fix bug in tr_cpMissingBytesInPiece()

This commit is contained in:
Jordan Lee 2011-06-25 13:31:25 +00:00
parent 35fb00fd9e
commit 42a49a6c70
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ tr_cpMissingBytesInPiece( const tr_completion * cp, tr_piece_index_t piece )
size_t haveBytes = 0;
tr_block_index_t 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;
if( tr_bitfieldHas( &cp->blockBitfield, l ) )
haveBytes += tr_torBlockCountBytes( cp->tor, l );