]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #4332 "countRange/countArray exception" -- fix bug in tr_cpMissingBytesI...
authorJordan Lee <jordan@transmissionbt.com>
Sat, 25 Jun 2011 13:31:25 +0000 (13:31 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 25 Jun 2011 13:31:25 +0000 (13:31 +0000)
libtransmission/completion.c

index 84306e897112d9d26e8ce8bc9fddd9931d6f5b14..e11bed310f13da02a864da6ee2db7227803eab20 100644 (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 );