mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) fix a couple of dead assignments, and a possible null pointer dereference, found by clang
This commit is contained in:
parent
6044947ab0
commit
7c6fbfb80f
3 changed files with 1 additions and 5 deletions
|
@ -349,15 +349,12 @@ bandwidthUsedImpl( tr_bandwidth * b,
|
|||
uint64_t now )
|
||||
{
|
||||
struct tr_band * band;
|
||||
size_t oldBytesLeft;
|
||||
|
||||
assert( tr_isBandwidth( b ) );
|
||||
assert( tr_isDirection( dir ) );
|
||||
|
||||
band = &b->band[dir];
|
||||
|
||||
oldBytesLeft = band->bytesLeft;
|
||||
|
||||
if( band->isLimited && isPieceData )
|
||||
band->bytesLeft -= MIN( band->bytesLeft, byteCount );
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ parseHandshake( tr_handshake * handshake,
|
|||
tr_peerIoEnableFEXT( handshake->io, HANDSHAKE_HAS_FASTEXT( reserved ) );
|
||||
|
||||
/* This doesn't depend on whether the torrent is private. */
|
||||
if( tor->session->isDHTEnabled )
|
||||
if( tor && tor->session->isDHTEnabled )
|
||||
tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) );
|
||||
|
||||
return HANDSHAKE_OK;
|
||||
|
|
|
@ -149,7 +149,6 @@ tr_dhtInit(tr_session *ss)
|
|||
/* Note that DHT ids need to be distributed uniformly,
|
||||
* so it should be something truly random. */
|
||||
tr_cryptoRandBuf( myid, 20 );
|
||||
have_id = TRUE;
|
||||
}
|
||||
|
||||
v[0] = 'T';
|
||||
|
|
Loading…
Reference in a new issue