Use find() instead of walking strings 'by hand' in IsValidHostName

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1363 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-02-02 15:23:03 +00:00
parent 422ab3288e
commit cd88623cbe

View File

@@ -18,16 +18,12 @@ CServer::CServer(const CString& sName, unsigned short uPort, const CString& sPas
CServer::~CServer() {}
bool CServer::IsValidHostName(const CString& sHostName) {
const char* p = sHostName.c_str();
if (sHostName.empty()) {
return false;
}
while (*p) {
if (*p++ == ' ') {
return false;
}
if (sHostName.find(' ') != CString::npos) {
return false;
}
return true;