Various minor portability fixes.
[fwd] / un.c
diff --git a/un.c b/un.c
index c0a2cc9..6b3c71f 100644 (file)
--- a/un.c
+++ b/un.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: un.c,v 1.1 1999/07/26 23:34:11 mdw Exp $
+ * $Id: un.c,v 1.2 1999/07/27 18:30:53 mdw Exp $
  *
  * Protocol specific definitions for Unix-domain sockets
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: un.c,v $
+ * Revision 1.2  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.1  1999/07/26 23:34:11  mdw
  * New socket address types.
  *
@@ -37,6 +40,7 @@
 /*----- Header files ------------------------------------------------------*/
 
 #include "config.h"
+#undef sun /* Cretins */
 
 #include <ctype.h>
 #include <errno.h>
@@ -94,6 +98,7 @@ static addr *un_read(scanner *sc, unsigned type)
               d.len + 1);
   ua->a.ops = &un_ops;
   ua->a.sz = offsetof(struct sockaddr_un, sun_path) + d.len + 1;
+  memset(&ua->sun, 0, ua->a.sz);
   ua->sun.sun_family = AF_UNIX;
   memcpy(ua->sun.sun_path, d.buf, d.len + 1);
   dstr_destroy(&d);