From 3cb5ba7eed2fe1527a09715d66686c3f7cf83953 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 8 Aug 2007 05:17:51 +0000 Subject: [PATCH] (trunk) fix assertion failure reported by kdrweez in http://transmission.m0k.org/forum/viewtopic.php?t=2096 --- libtransmission/completion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/completion.c b/libtransmission/completion.c index afcfa6e26..e0d69edcf 100644 --- a/libtransmission/completion.c +++ b/libtransmission/completion.c @@ -122,9 +122,9 @@ tr_cpEnsureDoneValid( const tr_completion_t * ccp ) /* the last piece/block is probably smaller than the others */ 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 ) ) - have -= ( tor->blockSize - ( info->totalSize % tor->blockSize ) ); + have -= ( tor->blockSize - tr_torBlockCountBytes(tor,tor->blockCount-1) ); } assert( have <= total );