noip.c (decode_inet_addr): Fix doc comment.
[preload-hacks] / noip.c
diff --git a/noip.c b/noip.c
index 9c5cd68..8a67b64 100644 (file)
--- a/noip.c
+++ b/noip.c
@@ -353,7 +353,7 @@ static void wildcard_address(int af, struct sockaddr *sa)
     } break;
     case AF_INET6: {
       struct sockaddr_in6 *sin6 = SIN6(sa);
-      memset(sin6, 0, sizeof(sin6));
+      memset(sin6, 0, sizeof(*sin6));
       sin6->sin6_family = AF_INET6;
       sin6->sin6_port = 0;
       sin6->sin6_addr = in6addr_any;
@@ -677,10 +677,10 @@ static int encode_inet_addr(struct sockaddr_un *sun,
 }
 
 /* Decode the Unix address SUN to an Internet address SIN.  If AF_HINT is
- * nonzero, an empty address (indicative of an unbound Unix-domain socket) of
- * the is translated to a wildcard Internet address of the appropriate
- * family.  Returns zero on success; -1 on failure (e.g., it wasn't one of
- * our addresses).
+ * nonzero, an empty address (indicative of an unbound Unix-domain socket) is
+ * translated to a wildcard Internet address of the appropriate family.
+ * Returns zero on success; -1 on failure (e.g., it wasn't one of our
+ * addresses).
  */
 static int decode_inet_addr(struct sockaddr *sa, int af_hint,
                            const struct sockaddr_un *sun,
@@ -1436,13 +1436,13 @@ static void create_sockdir(void)
 {
   struct stat st;
 
-  if (stat(sockdir, &st)) {
+  if (lstat(sockdir, &st)) {
     if (errno == ENOENT) {
       if (mkdir(sockdir, 0700)) {
        perror("noip: creating socketdir");
        exit(127);
       }
-      if (!stat(sockdir, &st))
+      if (!lstat(sockdir, &st))
        goto check;
     }
     perror("noip: checking socketdir");