From 0ed6ae04d6867e588233f18791e9ad061268016c Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 16 Apr 2015 11:15:58 -0700 Subject: [PATCH] Change this offsetof computation to use c89 offsetof. Tested: --- socket/sys/un.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket/sys/un.h b/socket/sys/un.h index 332ba0ecc79..8a3a9c7016c 100644 --- a/socket/sys/un.h +++ b/socket/sys/un.h @@ -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 -- 2.47.2