Changeset 6614


Ignore:
Timestamp:
Aug 21, 2008, 5:03:44 PM (13 years ago)
Author:
charles
Message:

fix metainfo bug from earlier today. (m1b, andersos)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r6613 r6614  
    145145
    146146    *setme_end = end + 1 + len;
    147     *setme_str = (uint8_t*) tr_strndup( end + 1, len );
     147    *setme_str = tr_memdup( end+1, len );
    148148    *setme_strlen = len;
    149149    return TR_OK;
     
    510510{
    511511    tr_bencInit( val, TYPE_STR );
     512
    512513    val->val.s.s = tr_strndup( str, len );
    513     val->val.s.i = val->val.s.s ? strlen( val->val.s.s ) : 0;
     514
     515    if( val->val.s.s == NULL )
     516        val->val.s.i = 0;
     517    else if( len < 0 )
     518        val->val.s.i = strlen( val->val.s.s );
     519    else
     520        val->val.s.i = len;
    514521}
    515522
Note: See TracChangeset for help on using the changeset viewer.