Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Rebuilding from CVS on Snow Leopard



On Sep 29,  9:05pm, Jun T. wrote:
} Subject: Re: Rebuilding from CVS on Snow Leopard
}
} I think it would be better to use sizeof(soun.sun_path) in place
} of UNIX_PATH_MAX. Or use sizeof(soun.sun_path)-1 so that sun_path
} is always null terminated.

How about this, then?

Index: socket.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/Modules/socket.c,v
retrieving revision 1.9
diff -c -r1.9 socket.c
--- socket.c	26 Nov 2007 17:38:14 -0000	1.9
+++ socket.c	29 Sep 2009 14:42:00 -0000
@@ -34,7 +34,7 @@
 #include <sys/un.h>
 
 #ifndef UNIX_PATH_MAX
-# define UNIX_PATH_MAX 108
+# define UNIX_PATH_MAX (sizeof(soun.sun_path)-1)
 #endif
 
 /*


(Or the equivalent without the dependency on the local variable name
"soun".)



Messages sorted by: Reverse Date, Date, Thread, Author