mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Added IsValidHostName()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@214 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
16
Server.cpp
16
Server.cpp
@@ -10,6 +10,22 @@ CServer::CServer(const string& sName, unsigned short uPort, const string& sPass,
|
||||
|
||||
CServer::~CServer() {}
|
||||
|
||||
bool CServer::IsValidHostName(const string& sHostName) {
|
||||
const char* p = sHostName.c_str();
|
||||
|
||||
if (sHostName.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (*p) {
|
||||
if (*p++ == ' ') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const string& CServer::GetName() const { return m_sName; }
|
||||
unsigned short CServer::GetPort() const { return m_uPort; }
|
||||
const string& CServer::GetPass() const { return m_sPass; }
|
||||
|
||||
Reference in New Issue
Block a user