From: deraadt Date: Thu, 3 Apr 1997 05:52:35 +0000 (+0000) Subject: ensure host_addr[] remains nicely aligned; pr#145, grr@shandakor.tharsis.com X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=11fca95d3f3256b88499230bb1e4c120700491d6;p=openbsd ensure host_addr[] remains nicely aligned; pr#145, grr@shandakor.tharsis.com --- 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 @@ -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;