(trunk) fix warnings found by the clang static analyzer, reported & patched by wereHamster

This commit is contained in:
Charles Kerr
2009-12-07 04:06:14 +00:00
parent 907c67ba78
commit 4e252aa106
7 changed files with 24 additions and 26 deletions
+3 -7
View File
@@ -1174,11 +1174,8 @@ printDetails( tr_benc * top )
char buf[512];
char buf2[512];
int64_t i, j, k;
tr_bool isStopped;
tr_bool boolVal;
isStopped = tr_bencDictFindInt( t, "status", &i ) && (i==TR_STATUS_STOPPED);
printf( "NAME\n" );
if( tr_bencDictFindInt( t, "id", &i ) )
printf( " Id: %" PRId64 "\n", i );
@@ -1876,14 +1873,13 @@ main( int argc,
if( host == NULL )
host = tr_strdup( DEFAULT_HOST );
exit_status |= readargs( argc, (const char**)argv );
if( reqCount )
exit_status = processRequests( host, port, (const char**)reqs, reqCount );
else {
readargs( argc, (const char**)argv );
if( reqCount == 0 ) {
showUsage( );
return EXIT_FAILURE;
}
exit_status = processRequests( host, port, (const char**)reqs, reqCount );
for( i=0; i<reqCount; ++i )
tr_free( reqs[i] );