]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Функцію перетворення радку на IP-адресу замынено на inet_pton
[stg.git] / stglibs / common.lib / common.cpp
index 915772bba0cbc75764a49622c97e2424a962369a..57b37bdfdbb98aeb5915e804962cbe0a45098c82 100644 (file)
@@ -23,8 +23,8 @@
  */
 
  /*
- $Revision: 1.41 $
- $Date: 2010/11/03 10:26:30 $
+ $Revision: 1.42 $
+ $Date: 2010/11/08 10:11:19 $
  $Author: faust $
  */
 
 #include <sys/socket.h>
 #endif*/
 
+#ifdef FREE_BSD
+#include <sys/types.h>
+#endif
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#endif
+
 #include <iconv.h>
 
 #include <cstdlib>
@@ -406,7 +415,7 @@ for (int i = 0; i < maxIP; i++)
         }
 
     struct in_addr in;
-    if (!inet_aton(p1, &in))
+    if (inet_pton(AF_INET, p1, &in) != 1)
         {
         //printf("INADDR_NONE\n");
         return EINVAL;