mirror of
https://github.com/znc/znc.git
synced 2026-05-02 19:42:32 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user