On Thu, Apr 12, 2012 at 5:33 AM, 潘志彪 <bit.ke...@gmail.com> wrote: > LSB Version: > :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch > Distributor ID: CentOS > Description: CentOS release 5.4 (Final) > Release: 5.4 > Codename: Final > > ldd <my exe>: > libevent-2.0.so.5 => /usr/local/lib/libevent-2.0.so.5 (0x00002b8af3973000) > libevent_pthreads-2.0.so.5 => > /usr/local/lib/libevent_pthreads-2.0.so.5 (0x00002b8af3bb6000) > libevent_openssl-2.0.so.5 => /usr/local/lib/libevent_openssl-2.0.so.5 > (0x00002b8af3db8000) > > use func evbuffer_add_reference(), code tips: > evbuffer_add_printf(buf_, "\"detail\":\""); > evbuffer_add_reference(buf_, dp->detail, strlen(dp->detail), > NULL, NULL); > evbuffer_add_printf(buf_, "\""); > > sometimes result is wrong, especially when the string's length is long.
Do you have a small demonstration program that can reproduce this issue? When I try the code above, it seems to work okay for me. How are you extracting the result strings? -- Nick *********************************************************************** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-users in the body.