Fixes a crash (quite amazing that it didn't crash more often, actually...)

This commit is contained in:
Eric Petit 2006-01-31 07:11:28 +00:00
parent aa6c52ef46
commit 00ef8642bf
1 changed files with 3 additions and 2 deletions

View File

@ -140,7 +140,7 @@ void tr_chokingPulse( tr_choking_t * c )
tr_peerChoke( peersCanChoke[i] );
peersCanChokeCount -= willChoke;
memmove( &peersCanChoke[0], &peersCanChoke[willChoke],
peersCanChokeCount );
peersCanChokeCount * sizeof( tr_peer_t * ) );
}
else if( unchokedCount < c->slots && peersCanUnchokeCount > 0 )
{
@ -161,7 +161,8 @@ void tr_chokingPulse( tr_choking_t * c )
tr_peerUnchoke( peersCanUnchoke[peersCanUnchokeCount - 1] );
peersCanChokeCount--;
peersCanUnchokeCount--;
memmove( &peersCanChoke[0], &peersCanChoke[1], peersCanChokeCount );
memmove( &peersCanChoke[0], &peersCanChoke[1],
peersCanChokeCount * sizeof( tr_peer_t * ) );
}
free( peersCanChoke );