mirror of
https://github.com/transmission/transmission
synced 2025-03-19 18:25:38 +00:00
(trunk libT) fix small dead code. found by clang static analyzer and reported by d0k
This commit is contained in:
parent
eb30e24be0
commit
b2a6def953
3 changed files with 4 additions and 5 deletions
|
@ -353,7 +353,7 @@ Boolean
|
|||
tr_utf8_validate( const char * str, int max_len, const char ** end )
|
||||
{
|
||||
const UTF8* source = (const UTF8*) str;
|
||||
const UTF8* sourceEnd = source;
|
||||
const UTF8* sourceEnd;
|
||||
|
||||
if( max_len == 0 )
|
||||
return true;
|
||||
|
|
|
@ -530,7 +530,6 @@ tr_netBindTCP( const tr_address * addr, tr_port port, tr_bool suppressMsgs )
|
|||
struct sockaddr_storage sock;
|
||||
const int type = SOCK_STREAM;
|
||||
int addrlen;
|
||||
int retval;
|
||||
|
||||
#if defined( SO_REUSEADDR ) || defined( SO_REUSEPORT ) || defined( IPV6_V6ONLY )
|
||||
int optval = 1;
|
||||
|
@ -548,8 +547,8 @@ tr_netBindTCP( const tr_address * addr, tr_port port, tr_bool suppressMsgs )
|
|||
|
||||
#ifdef IPV6_V6ONLY
|
||||
if( addr->type == TR_AF_INET6 &&
|
||||
( retval = setsockopt( s, IPPROTO_IPV6, IPV6_V6ONLY, &optval,
|
||||
sizeof( optval ) ) ) == -1 ) {
|
||||
setsockopt( s, IPPROTO_IPV6, IPV6_V6ONLY, &optval,
|
||||
sizeof( optval ) ) == -1 ) {
|
||||
/* the kernel may not support this. if not, ignore it */
|
||||
if( errno != ENOPROTOOPT )
|
||||
return -errno;
|
||||
|
|
|
@ -84,7 +84,7 @@ struct tr_web
|
|||
static struct tr_web_sockinfo *
|
||||
getSockinfo( tr_web * web, int fd, tr_bool createIfMissing )
|
||||
{
|
||||
tr_list * l = web->fds;
|
||||
tr_list * l;
|
||||
|
||||
for( l=web->fds; l!=NULL; l=l->next ) {
|
||||
struct tr_web_sockinfo * s = l->data;
|
||||
|
|
Loading…
Add table
Reference in a new issue