From 6196fda6614613705513e4a933604b956de82e72 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 27 Jul 2001 23:17:40 +0000 Subject: [PATCH] don't seg if looking up the ip of hostname fails (which on a properly configured system, shouldn't happen, but oh well) --- nq/source/net_udp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nq/source/net_udp.c b/nq/source/net_udp.c index 1332a754a..6f9eb19bd 100644 --- a/nq/source/net_udp.c +++ b/nq/source/net_udp.c @@ -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) {