diff --git a/IRCSock.cpp b/IRCSock.cpp index 8fdfeea8..f69057dd 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -88,7 +88,7 @@ void CIRCSock::ReadLine(const CString& sData) { return; } else if (sLine.Equals("ERROR ", false, 6)) { //ERROR :Closing Link: nick[24.24.24.24] (Excess Flood) - CString sError(sLine.substr(7)); + CString sError(sLine.substr(6)); if (sError.Left(1) == ":") { sError.LeftChomp(); diff --git a/modules/adminlog.cpp b/modules/adminlog.cpp index bf384bf5..a7ceebf9 100644 --- a/modules/adminlog.cpp +++ b/modules/adminlog.cpp @@ -52,7 +52,7 @@ public: if (sLine.Equals("ERROR ", false, 6)) { //ERROR :Closing Link: nick[24.24.24.24] (Excess Flood) //ERROR :Closing Link: nick[24.24.24.24] Killer (Local kill by Killer (reason)) - CString sError(sLine.substr(7)); + CString sError(sLine.substr(6)); if (sError.Left(1) == ":") sError.LeftChomp(); Log("[" + m_pUser->GetUserName() + "] disconnected from IRC: " + diff --git a/modules/away.cpp b/modules/away.cpp index a6d7bea8..a09f55b6 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -400,7 +400,7 @@ private: CBlowfish c(m_sPassword, BF_DECRYPT); sBuffer = c.Crypt(sFile); - if (sBuffer.substr(0, strlen(CRYPT_VERIFICATION_TOKEN)) != CRYPT_VERIFICATION_TOKEN) + if (sBuffer.Left(strlen(CRYPT_VERIFICATION_TOKEN)) != CRYPT_VERIFICATION_TOKEN) { // failed to decode :( PutModule("Unable to decode Encrypted messages"); diff --git a/modules/extra/email.cpp b/modules/extra/email.cpp index cc574f9c..eed3094a 100644 --- a/modules/extra/email.cpp +++ b/modules/extra/email.cpp @@ -154,7 +154,7 @@ public: virtual void ReadLine(const CS_STRING & sLine) { - if (sLine.substr(0, 5) == "From ") + if (sLine.Left(5) == "From ") { if (!m_sMailBuffer.empty()) { @@ -168,7 +168,7 @@ public: void ProcessMail() { EmailST tmp; - tmp.sUidl = (char *)CMD5(m_sMailBuffer.substr(0, 255)); + tmp.sUidl = (char *)CMD5(m_sMailBuffer.Left(255)); VCString vsLines; VCString::iterator it; @@ -200,15 +200,7 @@ private: void CEmail::OnModCommand(const CString& sCommand) { - CString::size_type iPos = sCommand.find(" "); - CString sCom, sArgs; - if (iPos == CString::npos) - sCom = sCommand; - else - { - sCom = sCommand.substr(0, iPos); - sArgs = sCommand.substr(iPos + 1, CString::npos); - } + CString sCom = sCommand.Token(0); if (sCom == "timers") {