Skip to content

Commit 00f4fa5

Browse files
authored
Merge pull request #8 from SimonCahill/fix/no-conn-with-dash-i
Bug Fix
2 parents d8a4ea6 + e9de2ff commit 00f4fa5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

main.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ int main(int32_t argC, char** argV) {
6262
cout << "# Statistics per IP" << endl;
6363
cout << "| Host | Accepted | Closed |" << endl
6464
<< "|------------------------|----------|--------|" << endl;
65-
for (const auto& connection : connectionList) {
66-
totalAcceptedConnections += connection.second.first;
67-
totalClosedConnections += connection.second.second;
68-
string lastSpacer;
65+
}
6966

67+
for (const auto& connection : connectionList) {
68+
totalAcceptedConnections += connection.second.first;
69+
totalClosedConnections += connection.second.second;
70+
71+
if (g_printIpStatistics) {
72+
string lastSpacer;
7073
cout << "|" << (lastSpacer = getSpacerString(24, connection.first.size()))
7174
<< connection.first << string(24 - connection.first.size() - lastSpacer.size(), ' ')
7275
<< "|";
@@ -82,8 +85,8 @@ int main(int32_t argC, char** argV) {
8285
<< connection.second.second << string(8 - strLength - lastSpacer.size(), ' ')
8386
<< "|" << endl;
8487
}
85-
cout << endl;
8688
}
89+
if (g_printIpStatistics) { cout << endl; }
8790

8891
if (g_printConnectionStatistics) {
8992
// Prepare everything for markdown table while keeping the table code clean-ish

0 commit comments

Comments
 (0)