Ignore:
Timestamp:
Oct 14, 2008, 3:03:29 AM (13 years ago)
Author:
charles
Message:

have tr_buildPath() allocate memory from the heap rather than using an input buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r6892 r6896  
    546546}
    547547
    548 void
    549 tr_buildPath( char *      buf,
    550               size_t      buflen,
    551               const char *first_element,
    552               ... )
    553 {
     548char*
     549tr_buildPath( const char *first_element, ... )
     550{
     551    char            * ret;
    554552    struct evbuffer * evbuf;
    555     const char *      element = first_element;
     553    const char      * element = first_element;
    556554    va_list           vl;
    557555
     
    567565    }
    568566
    569     if( EVBUFFER_LENGTH( evbuf ) )
    570         tr_strlcpy( buf, EVBUFFER_DATA( evbuf ), buflen );
    571     else
    572         *buf = '\0';
    573 
    574567    va_end( vl );
     568    ret = tr_strndup( EVBUFFER_DATA( evbuf ), EVBUFFER_LENGTH( evbuf ) );
    575569    evbuffer_free( evbuf );
     570    return ret;
    576571}
    577572
Note: See TracChangeset for help on using the changeset viewer.