summaryrefslogtreecommitdiffstats
path: root/examples/network/fortuneserver/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/fortuneserver/server.cpp')
-rw-r--r--examples/network/fortuneserver/server.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index 52b7d61..06f6eeb 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -68,8 +68,10 @@ Server::Server(QWidget *parent)
// use the first non-localhost IPv4 address
for (int i = 0; i < ipAddressesList.size(); ++i) {
if (ipAddressesList.at(i) != QHostAddress::LocalHost &&
- ipAddressesList.at(i).toIPv4Address())
+ ipAddressesList.at(i).toIPv4Address()) {
ipAddress = ipAddressesList.at(i).toString();
+ break;
+ }
}
// if we did not find one, use IPv4 localhost
if (ipAddress.isEmpty())