mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
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:
parent
e69c1e8918
commit
6196fda661
1 changed files with 4 additions and 1 deletions
|
@ -133,7 +133,10 @@ UDP_Init (void)
|
||||||
// determine my name & address
|
// determine my name & address
|
||||||
gethostname (buff, MAXHOSTNAMELEN);
|
gethostname (buff, MAXHOSTNAMELEN);
|
||||||
local = gethostbyname (buff);
|
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 the quake hostname isn't set, set it to the machine name
|
||||||
if (strcmp (hostname->string, "UNNAMED") == 0) {
|
if (strcmp (hostname->string, "UNNAMED") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue