commit cb28e48d4355a23cf58e42b1d7a6d95594e6b72c
parent b6240a86f85c19a469d1370449f6b621725f9aba
Author: Kris Maglione <jg@suckless.org>
Date: Tue, 27 Mar 2007 17:27:59 -0400
Fixed length passed to bind.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libixp/socket.c b/libixp/socket.c
@@ -27,7 +27,7 @@ dial_unix(char *address) {
sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, address, sizeof(sa.sun_path));
- su_len = sizeof(sa) + strlen(sa.sun_path);
+ su_len = SUN_LEN(&sa);
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if(fd < 0) {
@@ -160,7 +160,7 @@ announce_unix(char *file) {
sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, file, sizeof(sa.sun_path));
- su_len = sizeof(sa) + strlen(sa.sun_path);
+ su_len = SUN_LEN(&sa);
unlink(file);