summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-04 18:27:54 +0000
committerrubidium <rubidium@openttd.org>2008-08-04 18:27:54 +0000
commitb1eaf763e12c4c03a865f7a44cbfe11fbd2121b2 (patch)
tree0b45d123f6c519c5b5de4435448b9d4eda17fe4a /src/network
parent5c3a18fa900df479166f281e245142a922557f80 (diff)
downloadopenttd-b1eaf763e12c4c03a865f7a44cbfe11fbd2121b2.tar.xz
(svn r13995) -Fix (r13988): some warnings of the compile farm.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/host.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index 87f92d1fd..dc620225c 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -43,14 +43,14 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // BEOS
if (sock < 0) {
DEBUG(net, 0, "[core] error creating socket");
- return;
+ return 0;
}
char *output_pointer = NULL;
int output_length = _netstat(sock, &output_pointer, 1);
if (output_length < 0) {
DEBUG(net, 0, "[core] error running _netstat");
- return;
+ return 0;
}
int index;
@@ -155,7 +155,7 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // !GET
}
const char *buf_end = buf + ifconf.ifc_len;
- int index;
+ int index = 0;
for (const char *p = buf; p < buf_end && index != 0;) {
const struct ifreq* req = (const struct ifreq*)p;
@@ -177,6 +177,8 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // !GET
}
closesocket(sock);
+
+ return index;
}
#endif /* all NetworkFindBroadcastIPsInternals */