sdennis101@geocities.com provided a fix for a segfault under uquake in

net_udp.c, applied.
This commit is contained in:
Joseph Carter 2000-03-17 20:05:50 +00:00
parent 4e5c289a19
commit 176bdca935

View file

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