summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/asr/gethostnamadr.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libc/asr/gethostnamadr.c b/lib/libc/asr/gethostnamadr.c
index 1ed1dcf460c..635306cbe54 100644
--- a/lib/libc/asr/gethostnamadr.c
+++ b/lib/libc/asr/gethostnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr.c,v 1.4 2013/04/01 15:49:54 deraadt Exp $ */
+/* $OpenBSD: gethostnamadr.c,v 1.5 2013/04/04 17:49:33 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -26,10 +26,6 @@
#include "asr.h"
-#define PALIGN(p, l) \
- ((char *)(p) + (((uintptr_t)(p) % (l)) ? \
- (l) - (uintptr_t)(p) % (l) : 0))
-
static struct hostent *_gethostbyname(const char *, int);
static void _fillhostent(const struct hostent *, struct hostent *, char *buf,
size_t);
@@ -52,7 +48,7 @@ _fillhostent(const struct hostent *h, struct hostent *r, char *buf, size_t len)
r->h_addr_list = _empty;
end = buf + len;
- ptr = (char **)PALIGN(buf, sizeof(char *));
+ ptr = (char **)ALIGN(buf);
if ((char *)ptr >= end)
return;
@@ -86,7 +82,7 @@ _fillhostent(const struct hostent *h, struct hostent *r, char *buf, size_t len)
pos += n + 1;
}
- pos = PALIGN(pos, r->h_length);
+ pos = (char*)ALIGN(pos);
if (pos >= end)
return;