]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Change this offsetof computation to use c89 offsetof. Tested:
authorNick Lewycky <nlewycky@google.com>
Thu, 16 Apr 2015 18:15:58 +0000 (11:15 -0700)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:05 +0000 (17:26 -0700)
socket/sys/un.h

index 332ba0ecc79dbd6b4f1440385f07dfa3798bbf9c..8a3a9c7016c9a92badb250a0dca6f1b024f6c92e 100644 (file)
@@ -40,7 +40,7 @@ struct sockaddr_un
 
 #ifdef __USE_MISC
 /* Evaluate to actual length of the `sockaddr_un' structure.  */
-# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path)       \
+# define SUN_LEN(ptr) (offsetof(struct sockaddr_un, sun_path)                 \
                      + strlen ((ptr)->sun_path))
 #endif