From 7a24257d005b9cfb1954a24d442465578d0b968f Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 13 Mar 2011 05:45:34 +0000 Subject: [PATCH] (trunk libT) tweaks by werehamster --- libtransmission/makemeta.c | 4 +--- libtransmission/rpcimpl.c | 8 +++----- libtransmission/utils.c | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index b8bedf7ca..302e6f6df 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -162,9 +162,7 @@ tr_metaInfoBuilderCreate( const char * topFile ) builderFileCompare ); ret->pieceSize = bestPieceSize( ret->totalSize ); - ret->pieceCount = ret->pieceSize - ? (int)( ret->totalSize / ret->pieceSize ) - : 0; + ret->pieceCount = (int)( ret->totalSize / ret->pieceSize ); if( ret->totalSize % ret->pieceSize ) ++ret->pieceCount; diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index 1501e50db..f6b28dbcf 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -1133,11 +1133,9 @@ gotNewBlocklist( tr_session * session, errno = 0; - if( !errno ) { - fd = tr_open_file_for_writing( filename ); - if( fd < 0 ) - tr_snprintf( result, sizeof( result ), _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( errno ) ); - } + fd = tr_open_file_for_writing( filename ); + if( fd < 0 ) + tr_snprintf( result, sizeof( result ), _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( errno ) ); if( !errno ) { const char * buf = response; diff --git a/libtransmission/utils.c b/libtransmission/utils.c index f2f0d950e..56e35420c 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -1361,7 +1361,6 @@ parseNumberSection( const char * str, int len, struct number_range * setme ) if( errno || ( end == tmp ) ) { success = FALSE; } else if( *end != '-' ) { - b = a; success = TRUE; } else { const char * pch = end + 1;