Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 3666:556ec82f4d93 legacy-trunk
Calculate length of AF_UNIX addr struct portably in getsockaddrarg().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 11 Jun 1996 18:36:33 +0000 |
| parents | 5188374377ae |
| children | cec27c93b5cb |
line wrap: on
line diff
--- a/Modules/socketmodule.c Tue Jun 11 18:35:24 1996 +0000 +++ b/Modules/socketmodule.c Tue Jun 11 18:36:33 1996 +0000 @@ -373,7 +373,7 @@ 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 */
