Ignore:
Timestamp:
Jan 31, 2008, 3:09:27 AM (15 years ago)
Author:
charles
Message:

fix off-by-one that was uncovered by the new benc's stricter parsing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r4876 r4878  
    292292            const uint8_t * end;
    293293            uint8_t * str;
    294             size_t strlen;
     294            size_t str_len;
    295295            int err;
    296296            benc_val_t * node;
    297297
    298             if(( err = tr_bencParseStr( buf, bufend, &end, &str, &strlen )))
     298            if(( err = tr_bencParseStr( buf, bufend, &end, &str, &str_len )))
    299299                return err;
    300300
     
    303303                return TR_ERROR;
    304304
    305             tr_bencInitStr( node, str, strlen, 0 );
     305            tr_bencInitStr( node, str, str_len, 0 );
    306306            buf = end;
    307307
     
    797797    struct WalkPrint * data = vdata;
    798798    printLeadingSpaces( data );
     799    fprintf( data->out, "string:  " );
    799800    for( ii = 0; val->val.s.i > ii; ii++ )
    800801    {
     
    808809        }
    809810    }
     811    fprintf( data->out, "\n" );
    810812}
    811813static void
Note: See TracChangeset for help on using the changeset viewer.