examples/network/fortuneserver/server.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/examples/network/fortuneserver/server.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/examples/network/fortuneserver/server.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -68,8 +68,10 @@
     // 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())