-fix time assertion introduce in last patch
[oweals/gnunet.git] / src / util / common_logging.c
index 19ae50257569c9bdf7749d85b8dea6341044c117..aebfc504ad66fb5574998c90afb3a304251111be 100644 (file)
@@ -1095,7 +1095,7 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
 {
   static char buf[256];
   char *ret;
-
+  
   ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
   strcpy (buf, ret);
   GNUNET_free (ret);
@@ -1139,7 +1139,14 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
 const char *
 GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen)
 {
-  static char buf[INET6_ADDRSTRLEN + 8];
+#ifndef WINDOWS
+#define LEN GNUNET_MAX ((INET6_ADDRSTRLEN + 8),         \
+                        (sizeof (struct sockaddr_un) - sizeof (sa_family_t)))
+#else
+#define LEN (INET6_ADDRSTRLEN + 8)
+#endif
+  static char buf[LEN];
+#undef LEN
   static char b2[6];
   const struct sockaddr_in *v4;
   const struct sockaddr_un *un;