Changeset 7253


Ignore:
Timestamp:
Dec 3, 2008, 5:28:09 AM (12 years ago)
Author:
charles
Message:

(libT) #1552: Blocklists fail when Windows newlines are present

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/blocklist.c

    r7231 r7253  
    199199
    200200int
    201 _tr_blocklistHasAddress( tr_blocklist            * b,
    202                          const struct tr_address * addr )
     201_tr_blocklistHasAddress( tr_blocklist     * b,
     202                         const tr_address * addr )
    203203{
    204204    uint32_t                   needle;
     
    258258    while( !fggets( &line, in ) )
    259259    {
    260         char *             rangeBegin;
    261         char *             rangeEnd;
    262         struct tr_address  addr;
     260        char * rangeBegin;
     261        char * rangeEnd;
     262        char * crpos;
     263        tr_address  addr;
    263264        struct tr_ip_range range;
    264265
     
    270271        if( !rangeEnd ){ free( line ); continue; }
    271272        *rangeEnd++ = '\0';
     273        if(( crpos = strchr( rangeEnd, '\r' )))
     274            *crpos = '\0';
    272275
    273276        if( !tr_pton( rangeBegin, &addr ) )
Note: See TracChangeset for help on using the changeset viewer.