From 65af28a0f46f3da32a849e45ea725db041376444 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 11 Jun 1996 18:36:33 +0000 Subject: Calculate length of AF_UNIX addr struct portably in getsockaddrarg(). --- Modules/socketmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- cgit v0.12