(trunk libT) fix r7535 bug reported by Rolcol

This commit is contained in:
Charles Kerr 2008-12-30 02:42:45 +00:00
parent cad0ec892c
commit 640c952ce8
1 changed files with 1 additions and 1 deletions

View File

@ -1420,7 +1420,7 @@ readBtPiece( tr_peermsgs * msgs,
while( i > 0 )
{
uint8_t buf[MAX_STACK_ARRAY_SIZE];
const size_t thisPass = MIN( n, sizeof( buf ) );
const size_t thisPass = MIN( i, sizeof( buf ) );
tr_peerIoReadBytes( msgs->peer->io, inbuf, buf, thisPass );
evbuffer_add( msgs->incoming.block, buf, thisPass );
i -= thisPass;