diff options
Diffstat (limited to 'src/resolver.c')
-rw-r--r-- | src/resolver.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resolver.c b/src/resolver.c index 243b7cd0..3ab0a50e 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -20,13 +20,13 @@ #include "config.h" #include "resolver.h" -#ifndef G_OS_WIN32 -#include <sys/socket.h> -#include <netdb.h> -#else /* G_OS_WIN32 */ +#if HAVE_WINSOCK2_H #include <ws2tcpip.h> #include <winsock.h> -#endif /* G_OS_WIN32 */ +#else +#include <sys/socket.h> +#include <netdb.h> +#endif #include <string.h> @@ -38,7 +38,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) struct sockaddr_in a4; #endif int ret; - char host[NI_MAXHOST], serv[NI_MAXSERV]; + char host[1024], serv[1024]; #if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED) if (sa->sa_family == AF_INET6 && @@ -64,14 +64,14 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) return NULL; } -#ifdef HAVE_UN +#if HAVE_UN if (sa->sa_family == AF_UNIX) /* "serv" contains corrupt information with unix sockets */ return g_strdup(host); #endif -#ifdef HAVE_IPV6 +#if HAVE_IPV6 if (strchr(host, ':') != NULL) return g_strconcat("[", host, "]:", serv, NULL); #endif |