From: P2P-Next Date: Thu, 12 Aug 2010 15:21:27 +0000 (+0300) Subject: instrumentation/hrktorrent: sized peers vector; fix iterator update X-Git-Tag: next-share-m32~11 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=8a6544de70aa133f7006a54b3696ac3fd97c663a;p=cs-p2p-next.git instrumentation/hrktorrent: sized peers vector; fix iterator update --- diff --git a/instrumentation/hrktorrent/core.cpp b/instrumentation/hrktorrent/core.cpp index e5de712..159e05c 100644 --- a/instrumentation/hrktorrent/core.cpp +++ b/instrumentation/hrktorrent/core.cpp @@ -81,6 +81,7 @@ CCore::StatusLoop(void* data) /* peer_info array for storing peer-specific information */ std::vector peers; + peers.resize(100); stdout_is_tty = (isatty(STDOUT_FILENO) == 1); if (stdout_is_tty) { @@ -149,6 +150,7 @@ CCore::StatusLoop(void* data) std::vector::iterator it = peers.begin(); while (it != peers.end()) { std::cout << it->ip << std::endl; + it++; } sleep(1);