We should include netinet/in.h to use sockaddr_in (POSIX.1-2001)
[novacoin.git] / src / net.cpp
index c4bd027..e5cb6d4 100644 (file)
@@ -13,6 +13,8 @@
 
 #ifdef WIN32
 #include <string.h>
+#else
+#include <netinet/in.h>
 #endif
 
 #ifdef USE_UPNP
@@ -159,14 +161,14 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha
                 }
                 if (pszKeyword == NULL)
                     break;
-                if (strLine.find(pszKeyword) != -1)
+                if (strLine.find(pszKeyword) != string::npos)
                 {
                     strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword));
                     break;
                 }
             }
             closesocket(hSocket);
-            if (strLine.find("<") != -1)
+            if (strLine.find("<") != string::npos)
                 strLine = strLine.substr(0, strLine.find("<"));
             strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r"));
             while (strLine.size() > 0 && isspace(strLine[strLine.size()-1]))