summaryrefslogtreecommitdiff
path: root/nscd/nscd_getserv_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_getserv_r.c')
-rw-r--r--nscd/nscd_getserv_r.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c
index 0ee83ff88c..6969fcb739 100644
--- a/nscd/nscd_getserv_r.c
+++ b/nscd/nscd_getserv_r.c
@@ -205,11 +205,10 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
/* A first check whether the buffer is sufficiently large is possible. */
/* Now allocate the buffer the array for the group members. We must
align the pointer and the base of the h_addr_list pointers. */
- align1 = ((__alignof__ (char *) - (cp - ((char *) 0)))
+ align1 = ((__alignof__ (char *) - ((uintptr_t) cp))
& (__alignof__ (char *) - 1));
- align2 = ((__alignof__ (char *) - ((cp + align1 + serv_resp.s_name_len
- + serv_resp.s_proto_len)
- - ((char *) 0)))
+ align2 = ((__alignof__ (char *) - ((uintptr_t) (cp + align1 + serv_resp.s_name_len
+ + serv_resp.s_proto_len)))
& (__alignof__ (char *) - 1));
if (buflen < (align1 + serv_resp.s_name_len + serv_resp.s_proto_len
+ align2