about summary refs log tree commit diff
path: root/nss/getXXent.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
committerAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
commitfb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff (patch)
treeb6d3b7b6350601fbb8f6cbf8f820d25c0ab59cdb /nss/getXXent.c
parent55c303acb873e478540042612f1028139454d4a4 (diff)
downloadglibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.gz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.xz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.zip
* 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.
Diffstat (limited to 'nss/getXXent.c')
-rw-r--r--nss/getXXent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nss/getXXent.c b/nss/getXXent.c
index ebe6fff5f0..0a13b79d87 100644
--- a/nss/getXXent.c
+++ b/nss/getXXent.c
@@ -70,7 +70,11 @@ LOOKUP_TYPE *
 GETFUNC_NAME (void)
 {
   static size_t buffer_size;
-  static LOOKUP_TYPE resbuf;
+  static union
+  {
+    LOOKUP_TYPE l;
+    void *ptr;
+  } resbuf;
   LOOKUP_TYPE *result;
   int save;
 
@@ -79,7 +83,7 @@ GETFUNC_NAME (void)
 
   result = (LOOKUP_TYPE *)
     __nss_getent ((getent_r_function) INTERNAL (REENTRANT_GETNAME),
-		  (void **) &resbuf, &buffer, BUFLEN, &buffer_size,
+		  &resbuf.ptr, &buffer, BUFLEN, &buffer_size,
 		  H_ERRNO_VAR);
 
   save = errno;