#include <errno.h>
#include <sys/types.h>
-#ifndef WIN32
+#ifndef _WIN32
# include <sys/socket.h>
#else
# include <winsock2.h>
+# undef EAFNOSUPPORT
# define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
{
case AF_INET:
if (snprintf (dst, len, "%hhu.%hhu.%hhu.%hhu",
- b[0], b[1], b[2], b[3]) <= len)
+ b[0], b[1], b[2], b[3]) >= len)
{
errno = ENOSPC;
return NULL;