From b4969ca513cdfd6aead8a3b52be6eb78217596bf Mon Sep 17 00:00:00 2001 From: tron Date: Tue, 23 May 2000 07:03:10 +0000 Subject: Fix an alignment problem introduced by the patch for PR lib/8032. Fixes PR lib/10048 by J.T. Conklin. --- lib/libc/net/gethnamaddr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/net/gethnamaddr.c b/lib/libc/net/gethnamaddr.c index 972d9d63468..fab95fac3fd 100644 --- a/lib/libc/net/gethnamaddr.c +++ b/lib/libc/net/gethnamaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: gethnamaddr.c,v 1.32 2000/04/25 13:47:38 itojun Exp $ */ +/* $NetBSD: gethnamaddr.c,v 1.33 2000/05/23 07:03:10 tron Exp $ */ /* * ++Copyright++ 1985, 1988, 1993 @@ -61,7 +61,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp "; #else -__RCSID("$NetBSD: gethnamaddr.c,v 1.32 2000/04/25 13:47:38 itojun Exp $"); +__RCSID("$NetBSD: gethnamaddr.c,v 1.33 2000/05/23 07:03:10 tron Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -903,13 +903,13 @@ _gethtbyname2(name, af) if (num == 0) return NULL; len = ptr - tmpbuf; - if (len > sizeof(hostbuf)) { + if (len > (sizeof(hostbuf) - ALIGNBYTES)) { free(tmpbuf); errno = ENOSPC; h_errno = NETDB_INTERNAL; return NULL; } - ptr = memcpy(hostbuf, tmpbuf, len); + ptr = memcpy((void *)ALIGN(hostbuf), tmpbuf, len); free(tmpbuf); host.h_name = ptr; -- cgit