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.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 839686657..78b00e95e 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -611,7 +611,7 @@ void ModuleManager::AddService(ServiceProvider& item) case SERVICE_DATA: case SERVICE_IOHOOK: { - if ((item.name.substr(0, 5) == "mode/") || (item.name.substr(0, 6) == "umode/")) + if ((!item.name.compare(0, 5, "mode/", 5)) || (!item.name.compare(0, 6, "umode/", 6))) throw ModuleException("The \"mode/\" and the \"umode\" service name prefixes are reserved."); DataProviders.insert(std::make_pair(item.name, &item)); -- cgit v1.3.1-10-gc9f91