don't seg if looking up the ip of hostname fails (which on a properly

configured system, shouldn't happen, but oh well)
This commit is contained in:
Bill Currie 2001-07-27 23:17:40 +00:00
parent e69c1e8918
commit 6196fda661
1 changed files with 4 additions and 1 deletions

View File

@ -133,7 +133,10 @@ UDP_Init (void)
// determine my name & address
gethostname (buff, MAXHOSTNAMELEN);
local = gethostbyname (buff);
myAddr = *(int *) local->h_addr_list[0];
if (local)
myAddr = *(int *) local->h_addr_list[0];
else
myAddr = 0;
// if the quake hostname isn't set, set it to the machine name
if (strcmp (hostname->string, "UNNAMED") == 0) {