Changeset 7552 for trunk/daemon/daemon.c


Ignore:
Timestamp:
Dec 30, 2008, 10:07:39 PM (12 years ago)
Author:
charles
Message:

(trunk libT) have tr_bencSaveAsJSON() use an evbuffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r7547 r7552  
    2323#include <signal.h>
    2424#include <unistd.h> /* daemon */
     25
     26#include <event.h>
    2527
    2628#include <libtransmission/transmission.h>
     
    246248    if( dumpSettings )
    247249    {
    248         char * str = tr_bencSaveAsJSON( &settings, NULL );
    249         fprintf( stderr, "%s", str );
    250         tr_free( str );
     250        struct evbuffer * buf = tr_getBuffer( );
     251
     252        tr_bencSaveAsJSON( &settings, buf );
     253        fprintf( stderr, "%s", (char*)EVBUFFER_DATA(buf) );
     254
     255        tr_releaseBuffer( buf );
    251256        return 0;
    252257    }
Note: See TracChangeset for help on using the changeset viewer.