diff options
author | Guido van Rossum <guido@python.org> | 1996-06-11 18:36:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-06-11 18:36:33 (GMT) |
commit | 65af28a0f46f3da32a849e45ea725db041376444 (patch) | |
tree | 2376b5859ad9b42c2dd24f7e0d70c74842345ba9 | |
parent | 53a9bf816487589dd0bc9fffe789de83e54305f2 (diff) | |
download | cpython-65af28a0f46f3da32a849e45ea725db041376444.zip cpython-65af28a0f46f3da32a849e45ea725db041376444.tar.gz cpython-65af28a0f46f3da32a849e45ea725db041376444.tar.bz2 |
Calculate length of AF_UNIX addr struct portably in getsockaddrarg().
-rw-r--r-- | Modules/socketmodule.c | 2 |
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 */ |