]> git.sesse.net Git - vlc/blobdiff - compat/inet_pton.c
input: add b_net variable in item
[vlc] / compat / inet_pton.c
index 7d7200be5fa047073d8dfaf28744893dcce856f8..fb825c20a4fc4e404a09d7a7d1f831725a14393f 100644 (file)
 #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
 
@@ -55,7 +56,7 @@ const char *inet_ntop (int af, const void *src, char *dst, int len)
     {
         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;