1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-19 02:05:32 +00:00

(trunk libT) fix small dead code. found by clang static analyzer and reported by d0k

This commit is contained in:
Charles Kerr 2009-05-13 19:04:14 +00:00
parent eb30e24be0
commit b2a6def953
3 changed files with 4 additions and 5 deletions

View file

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

View file

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

View file

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