From: P2P-Next Date: Wed, 11 Aug 2010 17:00:36 +0000 (+0300) Subject: instrumentation/hrktorrent: fix compile errors in PrintStatusStream function X-Git-Tag: next-share-m32~14 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=b0c66bdd8f6c8300cbccbd30681c302822496727;p=cs-p2p-next.git instrumentation/hrktorrent: fix compile errors in PrintStatusStream function --- diff --git a/instrumentation/hrktorrent/core.cpp b/instrumentation/hrktorrent/core.cpp index 8002a1d..623a979 100644 --- a/instrumentation/hrktorrent/core.cpp +++ b/instrumentation/hrktorrent/core.cpp @@ -36,16 +36,18 @@ GetETA(libtorrent::size_type done, libtorrent::size_type wanted, libtorrent::siz static void PrintStatusStream(std::stringstream &output, int columns, int stdout_is_tty) { + std::string s_output; + s_output = output.str(); if (stdout_is_tty) { - if(s.length() > columns) { - s.resize(columns - 3); - s.append(".."); + if(s_output.length() > columns) { + s_output.resize(columns - 3); + s_output.append(".."); } - else if(s.length() < columns) { - for(int i = 0; i < s.length() - columns; i++) - s.append(" "); + else if(s_output.length() < columns) { + for(int i = 0; i < s_output.length() - columns; i++) + s_output.append(" "); } } @@ -63,7 +65,6 @@ void* CCore::StatusLoop(void* data) { int curx, cury; - std::string s_output; std::stringstream output; struct winsize ws;