From 2b38f6f81a474be0cb6c33213a2a9a9258eed0e3 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 4 Jan 2009 04:37:26 +0000 Subject: [PATCH] (trunk libT) don't use void* when doing pointer math. --- libtransmission/peer-io.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index f6b469367..91a0f7ecf 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -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 );