Ignore:
Timestamp:
Aug 21, 2008, 4:12:17 PM (13 years ago)
Author:
charles
Message:

more metainfo/bencode cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r6595 r6613  
    191191        va_end( args );
    192192        evbuffer_add_printf( buf, " (%s:%d)\n", basename(myfile), line );
    193         fwrite( EVBUFFER_DATA(buf), 1, EVBUFFER_LENGTH(buf), fp );
     193        fwrite( EVBUFFER_DATA( buf ), 1, EVBUFFER_LENGTH( buf ), fp );
    194194
    195195        tr_free( myfile );
     
    544544    }
    545545    if( EVBUFFER_LENGTH(evbuf) )
    546         tr_strlcpy( buf, (char*)EVBUFFER_DATA(evbuf), buflen );
     546        tr_strlcpy( buf, EVBUFFER_DATA( evbuf ), buflen );
    547547    else
    548548        *buf = '\0';
     
    665665
    666666    if( evbuffer_add_vprintf( buf, fmt, ap ) != -1 )
    667         ret = tr_strdup( (char*)EVBUFFER_DATA( buf ) );
     667        ret = tr_strdup( EVBUFFER_DATA( buf ) );
    668668
    669669    va_end( ap );
     
    939939
    940940int
    941 tr_stringEndsWith( const char * str, const char * end )
    942 {
    943     const size_t slen = strlen( str );
    944     const size_t elen = strlen( end );
    945     return slen>=elen && !memcmp( &str[slen-elen], end, elen );
    946 }
    947 
    948 int
    949941tr_snprintf( char * buf, size_t buflen, const char * fmt, ... )
    950942{
     
    964956 */
    965957size_t
    966 tr_strlcpy(char *dst, const char *src, size_t siz)
     958tr_strlcpy(char *dst, const void * src, size_t siz)
    967959{
    968960#ifdef HAVE_STRLCPY
     
    992984    }
    993985
    994     return(s - src - 1); /* count does not include NUL */
     986    return(s - (char*)src - 1); /* count does not include NUL */
    995987#endif
    996988}
Note: See TracChangeset for help on using the changeset viewer.