mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r12968) -Fix: Don't segfault when adding a server if 0.0.0.0 was entered for the address.
This commit is contained in:
parent
3260abec08
commit
28e1da6c5d
@ -494,6 +494,8 @@ void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually)
|
||||
|
||||
// Clear item in gamelist
|
||||
item = NetworkGameListAddItem(inet_addr(inet_ntoa(out_addr.sin_addr)), ntohs(out_addr.sin_port));
|
||||
if (item == NULL) return;
|
||||
|
||||
if (StrEmpty(item->info.server_name)) {
|
||||
memset(&item->info, 0, sizeof(item->info));
|
||||
ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name));
|
||||
|
Loading…
Reference in New Issue
Block a user