From 0b3f568a7506fb7ddc9a24d6ab12a969befb923d Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 26 May 2014 12:07:22 +0200 Subject: Switch to std::string::compare() from substr() in a couple of places --- src/modules/m_alias.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_alias.cpp') diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 9055a8bf8..764761099 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -302,28 +302,28 @@ class ModuleAlias : public Module result.append(GetVar(var, original_line)); i += len - 1; } - else if (newline.substr(i, 5) == "$nick") + else if (!newline.compare(i, 5, "$nick", 5)) { result.append(user->nick); i += 4; } - else if (newline.substr(i, 5) == "$host") + else if (!newline.compare(i, 5, "$host", 5)) { result.append(user->host); i += 4; } - else if (newline.substr(i, 5) == "$chan") + else if (!newline.compare(i, 5, "$chan", 5)) { if (chan) result.append(chan->name); i += 4; } - else if (newline.substr(i, 6) == "$ident") + else if (!newline.compare(i, 6, "$ident", 6)) { result.append(user->ident); i += 5; } - else if (newline.substr(i, 6) == "$vhost") + else if (!newline.compare(i, 6, "$vhost", 6)) { result.append(user->dhost); i += 5; -- cgit v1.3.1-10-gc9f91