From d4ee27357309dc63577713051b8264837f1f0834 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 19 Jul 2008 09:45:56 +0000 Subject: [PATCH] fix print out issue in lazy_entry --- src/lazy_bdecode.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lazy_bdecode.cpp b/src/lazy_bdecode.cpp index 7d2804ff8..a6a6ad6d0 100644 --- a/src/lazy_bdecode.cpp +++ b/src/lazy_bdecode.cpp @@ -366,7 +366,7 @@ namespace libtorrent switch (e.type()) { case lazy_entry::none_t: return os << "none"; - case lazy_entry::int_t: return os << e.int_value(); + case lazy_entry::int_t: return os << std::dec << std::setw(0) << e.int_value(); case lazy_entry::string_t: { bool printable = true; @@ -381,7 +381,8 @@ namespace libtorrent os << "'"; if (printable) return os << e.string_value() << "'"; for (int i = 0; i < e.string_length(); ++i) - os << std::hex << int((unsigned char)(str[i])); + os << std::hex << std::setfill('0') << std::setw(2) + << int((unsigned char)(str[i])); return os << "'"; } case lazy_entry::list_t: