HCoop
/
bpt
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03cce0c
)
Use 'offsetof' to avoid undefined behavior.
author
Mark H Weaver
<mhw@netris.org>
Wed, 12 Mar 2014 00:31:38 +0000
(20:31 -0400)
committer
Mark H Weaver
<mhw@netris.org>
Wed, 12 Mar 2014 01:39:20 +0000
(21:39 -0400)
* libguile/socket.c (SUN_LEN): Use 'offsetof'.
libguile/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/libguile/socket.c
b/libguile/socket.c
index
c0faae1
..
5b17a74
100644
(file)
--- a/
libguile/socket.c
+++ b/
libguile/socket.c
@@
-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