Changeset 10754


Ignore:
Timestamp:
Jun 15, 2010, 12:38:10 AM (13 years ago)
Author:
charles
Message:

(trunk libT) #3293 "fggets() is overkill for parsing the blocklist" -- fixed in trunk for 2.00

Location:
trunk/libtransmission
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/Makefile.am

    r10635 r10754  
    2727    crypto.c \
    2828    fdlimit.c \
    29     ggets.c \
    3029    handshake.c \
    3130    history.c \
     
    7877    completion.h \
    7978    fdlimit.h \
    80     ggets.h \
    8179    handshake.h \
    8280    history.h \
  • trunk/libtransmission/blocklist.c

    r10708 r10754  
    2828#include <assert.h>
    2929
    30 #include "ggets.h"
    31 
    3230#include "transmission.h"
    3331#include "platform.h"
     
    305303                         const char *   filename )
    306304{
    307     FILE *       in;
    308     FILE *       out;
    309     char *       line;
    310     int          inCount = 0;
    311     int          outCount = 0;
     305    FILE * in;
     306    FILE * out;
     307    int inCount = 0;
     308    int outCount = 0;
     309    char line[2048];
    312310    const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );
    313311
     
    335333    }
    336334
    337     while( !fggets( &line, in ) )
     335    while( fgets( line, sizeof( line ), in ) != NULL )
    338336    {
    339337        char * walk;
     
    350348            /* don't try to display the actual lines - it causes issues */
    351349            tr_err( _( "blocklist skipped invalid address at line %d" ), inCount );
    352             free( line );
    353350            continue;
    354351        }
    355 
    356         free( line );
    357352
    358353        if( fwrite( &range, sizeof( struct tr_ip_range ), 1, out ) != 1 )
Note: See TracChangeset for help on using the changeset viewer.