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

(trunk libT) don't use void* when doing pointer math.

This commit is contained in:
Charles Kerr 2009-01-04 04:37:26 +00:00
parent 8690d83ba4
commit 2b38f6f81a

View file

@ -663,16 +663,18 @@ tr_peerIoWriteBytes( tr_peerIo * io,
evbuffer_add( outbuf, bytes, byteCount );
break;
case PEER_ENCRYPTION_RC4:
case PEER_ENCRYPTION_RC4: {
const uint8_t * walk = bytes;
evbuffer_expand( outbuf, byteCount );
while( byteCount > 0 ) {
const size_t thisPass = MIN( byteCount, sizeof( tmp ) );
tr_cryptoEncrypt( io->crypto, thisPass, bytes, tmp );
tr_cryptoEncrypt( io->crypto, thisPass, walk, tmp );
evbuffer_add( outbuf, tmp, thisPass );
bytes += thisPass;
walk += thisPass;
byteCount -= thisPass;
}
break;
}
default:
assert( 0 );