(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
1 changed files with 5 additions and 3 deletions

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 );