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:
parent
8690d83ba4
commit
2b38f6f81a
1 changed files with 5 additions and 3 deletions
|
@ -663,16 +663,18 @@ tr_peerIoWriteBytes( tr_peerIo * io,
|
||||||
evbuffer_add( outbuf, bytes, byteCount );
|
evbuffer_add( outbuf, bytes, byteCount );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PEER_ENCRYPTION_RC4:
|
case PEER_ENCRYPTION_RC4: {
|
||||||
|
const uint8_t * walk = bytes;
|
||||||
evbuffer_expand( outbuf, byteCount );
|
evbuffer_expand( outbuf, byteCount );
|
||||||
while( byteCount > 0 ) {
|
while( byteCount > 0 ) {
|
||||||
const size_t thisPass = MIN( byteCount, sizeof( tmp ) );
|
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 );
|
evbuffer_add( outbuf, tmp, thisPass );
|
||||||
bytes += thisPass;
|
walk += thisPass;
|
||||||
byteCount -= thisPass;
|
byteCount -= thisPass;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert( 0 );
|
assert( 0 );
|
||||||
|
|
Loading…
Reference in a new issue