From 0093229d27dfc6aca4d7797bac1ba68c3c894773 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 25 Jun 2011 17:42:49 +0000 Subject: [PATCH] merge diff from aio branch to show partially bdecoded files with dump_torrent --- examples/dump_torrent.cpp | 4 ++-- src/lazy_bdecode.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/dump_torrent.cpp b/examples/dump_torrent.cpp index 6f4ac0909..57aa7e553 100644 --- a/examples/dump_torrent.cpp +++ b/examples/dump_torrent.cpp @@ -73,14 +73,14 @@ int main(int argc, char* argv[]) ret = lazy_bdecode(&buf[0], &buf[0] + buf.size(), e, ec, &pos , depth_limit, item_limit); + printf("\n\n----- raw info -----\n\n%s\n", print_entry(e).c_str()); + if (ret != 0) { fprintf(stderr, "failed to decode: '%s' at character: %d\n", ec.message().c_str(), pos); return 1; } - printf("\n\n----- raw info -----\n\n%s\n", print_entry(e).c_str()); - torrent_info t(e, ec); if (ec) { diff --git a/src/lazy_bdecode.cpp b/src/lazy_bdecode.cpp index 71acf3c40..a90f7fb36 100644 --- a/src/lazy_bdecode.cpp +++ b/src/lazy_bdecode.cpp @@ -52,7 +52,6 @@ namespace libtorrent { \ ec = code; \ if (error_pos) *error_pos = start - orig_start; \ - ret.clear(); \ return -1; \ } // fills in 'val' with what the string between start and the