aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2012-04-15 16:47:24 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-04-15 16:47:24 -0400
commitab9dc75a183c7a46e38e957ee3192d5febcccb3c (patch)
tree4af4074d5ef5859ce780af39f483cb02f5da5da2 /src/net.cpp
parent5a701eb7ea16b87b56263996ee8e98ec89e2a3d8 (diff)
The string class returns string::npos, when find() fails.
Noticed when sign-comparison warnings were enabled.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index b0f365061c..fb88891ad2 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -162,14 +162,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]))