From 8a6544de70aa133f7006a54b3696ac3fd97c663a Mon Sep 17 00:00:00 2001 From: P2P-Next Date: Thu, 12 Aug 2010 18:21:27 +0300 Subject: [PATCH] instrumentation/hrktorrent: sized peers vector; fix iterator update --- instrumentation/hrktorrent/core.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.20.1