summaryrefslogtreecommitdiff
path: root/lib/libc/net/gethostnamadr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-03 05:52:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-03 05:52:36 +0000
commitfd60cb774e55dfe68c1ac743625b9a458a9fb526 (patch)
treeb1e96a15d24c5883d860d46fdefc7a75f75dfac5 /lib/libc/net/gethostnamadr.c
parent3343cae317106f22781b1b46caca01f140e70e2a (diff)
ensure host_addr[] remains nicely aligned; pr#145, grr@shandakor.tharsis.com
Diffstat (limited to 'lib/libc/net/gethostnamadr.c')
-rw-r--r--lib/libc/net/gethostnamadr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index cfa58123540..e26ae989c50 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.15 1997/04/02 08:22:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.16 1997/04/03 05:52:35 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -88,7 +88,11 @@ static char *__ypdomain;
static struct hostent host;
static char *host_aliases[MAXALIASES];
static char hostbuf[BUFSIZ+1];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
+static union {
+ struct in_addr _host_in_addr;
+ u_char _host_addr[16]; /* IPv4 or IPv6 */
+} _host_addr_u;
+#define host_addr _host_addr_u._host_addr
static FILE *hostf = NULL;
static int stayopen = 0;