Changeset 6655


Ignore:
Timestamp:
Aug 27, 2008, 7:22:03 PM (13 years ago)
Author:
charles
Message:

(cli) #1226: errors should print to stderr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/cli.c

    r6639 r6655  
    135135    }
    136136    else
    137         printf( "unable to parse response (http code %lu) at %s", response_code, (char*)host );
     137        fprintf( stderr, "Unable to parse response (http code %lu) at %s", response_code, (char*)host );
    138138
    139139    --leftToScrape;
     
    236236    /* Check the options for validity */
    237237    if( !torrentPath ) {
    238         printf( "No torrent specified!\n" );
     238        fprintf( stderr, "No torrent specified!\n" );
    239239        return EXIT_FAILURE;
    240240    }
    241241    if( peerPort < 1 || peerPort > 65535 ) {
    242         printf( "Error: Port must between 1 and 65535; got %d\n", peerPort );
     242        fprintf( stderr, "Error: Port must between 1 and 65535; got %d\n", peerPort );
    243243        return EXIT_FAILURE;
    244244    }
    245245    if( peerSocketTOS < 0 || peerSocketTOS > 255 ) {
    246         printf( "Error: value must between 0 and 255; got %d\n", peerSocketTOS );
     246        fprintf( stderr, "Error: value must between 0 and 255; got %d\n", peerSocketTOS );
    247247        return EXIT_FAILURE;
    248248    }
     
    370370    if( !tor )
    371371    {
    372         printf( "Failed opening torrent file `%s'\n", torrentPath );
     372        fprintf( stderr, "Failed opening torrent file `%s'\n", torrentPath );
    373373        tr_sessionClose( h );
    374374        return EXIT_FAILURE;
     
    416416        printf( "\r%-*s", LINEWIDTH, line );
    417417        if( st->error )
    418             printf( "\n%s\n", st->errorString );
     418            fprintf( stderr, "\n%s\n", st->errorString );
    419419    }
    420420
Note: See TracChangeset for help on using the changeset viewer.