(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:
maedhros 2008-05-06 10:31:50 +00:00
parent 7e1ac0ce57
commit 8da41ec62e
1 changed files with 2 additions and 0 deletions

View File

@ -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));