From dce072ab7771efc5f6c2697c926b3a56dfe98a18 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 14 Jun 2007 22:40:27 +0000 Subject: Fixed properly this time git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7317 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_opermodes.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index a8aa615cf..e358492bc 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -65,14 +65,14 @@ class ModuleModesOnOper : public Module if (!strcmp(typen.c_str(),user->oper)) { std::string ThisOpersModes = Conf->ReadValue("type","modes",j); - char first = *(ThisOpersModes.c_str()); - if ((first != '+') && (first != '-')) - ThisOpersModes = "+" + ThisOpersModes; - if (ThisOpersModes != "") + if (!ThisOpersModes.empty()) { + char first = *(ThisOpersModes.c_str()); + if ((first != '+') && (first != '-')) + ThisOpersModes = "+" + ThisOpersModes; + std::string buf; stringstream ss(ThisOpersModes); - vector tokens; // split ThisOperModes into modes and mode params @@ -85,7 +85,7 @@ class ModuleModesOnOper : public Module // process mode params int i = 1; - for (unsigned int k = 1; k < tokens.size(); k++) + for (unsigned int k = 0; k < tokens.size(); k++) { modes[i] = tokens[k].c_str(); i++; @@ -106,8 +106,6 @@ class ModuleModesOnOper : public Module } }; -// stuff down here is the module-factory stuff. For basic modules you can ignore this. - class ModuleModesOnOperFactory : public ModuleFactory { public: -- cgit v1.2.3