From fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sun, 10 Nov 2002 11:06:36 +0000 Subject: * nss/getXXent.c (GETFUNC_NAME): Use union type to avoid strict aliasing problem. * nss/getXXbyYY_r.c (INTERNAL): Likewise. * nss/getnssent_r.c (__nss_getent_r): Likewise. (__nss_setent): Likewise. (__nss_getent_r): Likewise. * inet/getnetgrent_r.c (innetgr): Likewise. (__internal_setnetgrent_reuse): Likewise. (internal_getnetgrent_r): Likewise. * inet/ether_hton.c (ether_hostton): Likewise. * inet/ether_ntoh.c (ether_ntohost): Likewise. * sunrpc/netname.c (netname2user): Likewise. * sunrpc/publickey.c (getpublickey): Likewise. (getsecretkey): Likewise. --- sunrpc/netname.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sunrpc/netname.c') diff --git a/sunrpc/netname.c b/sunrpc/netname.c index dd275f1..07cddb7 100644 --- a/sunrpc/netname.c +++ b/sunrpc/netname.c @@ -147,32 +147,36 @@ netname2user (const char netname[MAXNETNAMELEN + 1], uid_t * uidp, gid_t * gidp, static service_user *startp; static netname2user_function start_fct; service_user *nip; - netname2user_function fct; + union + { + netname2user_function f; + void *ptr; + } fct; enum nss_status status = NSS_STATUS_UNAVAIL; int no_more; if (startp == NULL) { - no_more = __nss_publickey_lookup (&nip, "netname2user", (void **) &fct); + no_more = __nss_publickey_lookup (&nip, "netname2user", &fct.ptr); if (no_more) startp = (service_user *) - 1; else { startp = nip; - start_fct = fct; + start_fct = fct.f; } } else { - fct = start_fct; + fct.f = start_fct; no_more = (nip = startp) == (service_user *) - 1; } while (!no_more) { - status = (*fct) (netname, uidp, gidp, gidlenp, gidlist); + status = (*fct.f) (netname, uidp, gidp, gidlenp, gidlist); - no_more = __nss_next (&nip, "netname2user", (void **) &fct, status, 0); + no_more = __nss_next (&nip, "netname2user", &fct.ptr, status, 0); } return status == NSS_STATUS_SUCCESS; -- cgit v1.1