summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/socketmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index b77bdac..1c53d72 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -373,7 +373,7 @@ getsockaddrarg,PySocketSockObject *,s, PyObject *,args, struct sockaddr **,addr_
memcpy(addr->sun_path, path, len);
addr->sun_path[len] = 0;
*addr_ret = (struct sockaddr *) addr;
- *len_ret = len + sizeof addr->sun_family;
+ *len_ret = len + sizeof(*addr) - sizeof(addr->sun_path);
return 1;
}
#endif /* AF_UNIX */