From 95313e077a7277ea5edd4b776aa0199585215dfe Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Jul 2007 02:28:25 +0000 Subject: [PATCH] fix off-by-one in r2488 reported by BentMyWookie. Hooray for assert()! --- libtransmission/torrent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 43ce11535..98b13a201 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -173,7 +173,7 @@ tr_torrentInitFilePieces( tr_torrent_t * tor ) uint64_t lastByte; int lastBlock; if( i == (tor->info.pieceCount-1)) - lastByte = tor->info.totalSize; + lastByte = tor->info.totalSize - 1; else { lastByte = i + 1; lastByte *= tor->info.pieceSize;