changeset: 54:a4e758450a97
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Mar 27 17:27:59 2007 -0400
summary: Fixed length passed to bind.
diff -r 112371e1ac54 -r a4e758450a97 libixp/socket.c
--- a/libixp/socket.c Mon Mar 26 17:20:54 2007 -0400
+++ b/libixp/socket.c Tue Mar 27 17:27:59 2007 -0400
@@ -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);
Received on Tue Mar 27 2007 - 23:29:53 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:28 UTC