mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Use 'offsetof' to avoid undefined behavior.
* libguile/socket.c (SUN_LEN): Use 'offsetof'.
This commit is contained in:
parent
03cce0ce5f
commit
9fcee9da3f
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@
|
|||
|
||||
|
||||
#if defined (HAVE_UNIX_DOMAIN_SOCKETS) && !defined (SUN_LEN)
|
||||
#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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue