summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-09 21:36:09 +0000
committerrubidium <rubidium@openttd.org>2009-04-09 21:36:09 +0000
commit28bce241fde51391b8f7be286962afd0b86a1edf (patch)
treec86bd2039ce35b79a2fcd4d734922b6438215d60 /src/network/core
parent8477e923868029226626b890a7c6ef10fe12fa9c (diff)
downloadopenttd-28bce241fde51391b8f7be286962afd0b86a1edf.tar.xz
(svn r16005) -Fix: assertion when there is no last joined server; when you've got an unresolved address, the hostname cannot be resolved either so return it as-is.
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/address.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index 159c9cf11..541b4673b 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -14,7 +14,7 @@
const char *NetworkAddress::GetHostname()
{
- if (StrEmpty(this->hostname)) {
+ if (StrEmpty(this->hostname) && this->address.ss_family != AF_UNSPEC) {
assert(this->address_length != 0);
getnameinfo((struct sockaddr *)&this->address, this->address_length, this->hostname, sizeof(this->hostname), NULL, 0, NI_NUMERICHOST);
}