diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-05-26 12:07:22 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-05-26 12:07:22 +0200 |
commit | 0b3f568a7506fb7ddc9a24d6ab12a969befb923d (patch) | |
tree | 3351ce34fb05378f5d0269ce505de2a4c7498d82 /src/modules/m_spanningtree | |
parent | e3bcf95ee996c058c73879c12ac5a487f8dcdf46 (diff) |
Switch to std::string::compare() from substr() in a couple of places
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/uid.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 1d573b8b4..857e95da9 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -114,7 +114,7 @@ void TreeSocket::WriteLine(const std::string& original_line) // We're sending channel metadata line.erase(c, d-c); } - else if (line.substr(c, d-c) == " operquit") + else if (!line.compare(c, d-c, " operquit", 9)) { // ":22D METADATA 22DAAAAAX operquit :message" -> ":22DAAAAAX OPERQUIT :message" line = ":" + line.substr(b+1, c-b) + "OPERQUIT" + line.substr(d); diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 51f7026dd..e9e3e217d 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -37,7 +37,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st const std::string& modestr = params[8]; /* Is this a valid UID, and not misrouted? */ - if (params[0].length() != UIDGenerator::UUID_LENGTH || params[0].substr(0, 3) != remoteserver->GetID()) + if (params[0].length() != UIDGenerator::UUID_LENGTH || params[0].compare(0, 3, remoteserver->GetID())) throw ProtocolException("Bogus UUID"); /* Check parameters for validity before introducing the client, discovered by dmb */ if (modestr[0] != '+') |