1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(trunk) fix assertion failure reported by kdrweez in http://transmission.m0k.org/forum/viewtopic.php?t=2096

This commit is contained in:
Charles Kerr 2007-08-08 05:17:51 +00:00
parent 0588684061
commit 3cb5ba7eed

View file

@ -122,9 +122,9 @@ tr_cpEnsureDoneValid( const tr_completion_t * ccp )
/* the last piece/block is probably smaller than the others */ /* the last piece/block is probably smaller than the others */
if( !info->pieces[info->pieceCount-1].dnd ) { if( !info->pieces[info->pieceCount-1].dnd ) {
total -= ( info->pieceSize - ( info->totalSize % info->pieceSize ) ); total -= ( info->pieceSize - tr_torPieceCountBytes(tor,info->pieceCount-1) );
if( tr_cpBlockIsComplete( cp, tor->blockCount-1 ) ) if( tr_cpBlockIsComplete( cp, tor->blockCount-1 ) )
have -= ( tor->blockSize - ( info->totalSize % tor->blockSize ) ); have -= ( tor->blockSize - tr_torBlockCountBytes(tor,tor->blockCount-1) );
} }
assert( have <= total ); assert( have <= total );