mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-19 15:25:39 +00:00
(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.
This commit is contained in:
parent
8477e92386
commit
28bce241fd
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
const char *NetworkAddress::GetHostname()
|
const char *NetworkAddress::GetHostname()
|
||||||
{
|
{
|
||||||
if (StrEmpty(this->hostname)) {
|
if (StrEmpty(this->hostname) && this->address.ss_family != AF_UNSPEC) {
|
||||||
assert(this->address_length != 0);
|
assert(this->address_length != 0);
|
||||||
getnameinfo((struct sockaddr *)&this->address, this->address_length, this->hostname, sizeof(this->hostname), NULL, 0, NI_NUMERICHOST);
|
getnameinfo((struct sockaddr *)&this->address, this->address_length, this->hostname, sizeof(this->hostname), NULL, 0, NI_NUMERICHOST);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user