From b0c66bdd8f6c8300cbccbd30681c302822496727 Mon Sep 17 00:00:00 2001 From: P2P-Next Date: Wed, 11 Aug 2010 20:00:36 +0300 Subject: [PATCH] instrumentation/hrktorrent: fix compile errors in PrintStatusStream function --- instrumentation/hrktorrent/core.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; -- 2.20.1