]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_banexception.cpp
Make User:: nick/ident/dhost/fullname and some other things std::string instead of...
[user/henk/code/inspircd.git] / src / modules / m_banexception.cpp
index c39a741640edbd40bc515a1582f3e8a1c5175304..d90cbff2959eb90782d90784c9f05f3494409514 100644 (file)
@@ -67,18 +67,16 @@ public:
                        modelist* list;
                        chan->GetExt(be->GetInfoKey(), list);
                        
-                       if (list)
+                       if (!list)
                        {
-                               // No list, so let them in anyway.
+                               // No list, proceed normally
                                return 0;
                        }
 
-                       char mask[MAXBUF];
-                       snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
-
+                       std::string mask = std::string(user->nick) + "!" + user->ident + "@" + user->GetIPString();
                        for (modelist::iterator it = list->begin(); it != list->end(); it++)
                        {
-                               if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
+                               if (match(user->GetFullRealHost(), it->mask) || match(user->GetFullHost(), it->mask) || (match(mask, it->mask, true)))
                                {
                                        // They match an entry on the list, so let them in.
                                        return 1;
@@ -117,11 +115,10 @@ public:
                        LM->chan->GetExt(be->GetInfoKey(), list);
                        if (list)
                        {
-                               char mask[MAXBUF];
-                               snprintf(mask, MAXBUF, "%s!%s@%s", LM->user->nick, LM->user->ident, LM->user->GetIPString());
+                               std::string mask = std::string(LM->user->nick) + "!" + LM->user->ident + "@" + LM->user->GetIPString();
                                for (modelist::iterator it = list->begin(); it != list->end(); it++)
                                {
-                                       if (match(LM->user->GetFullRealHost(), it->mask.c_str()) || match(LM->user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
+                                       if (match(LM->user->GetFullRealHost(), it->mask) || match(LM->user->GetFullHost(), it->mask) || (match(mask, it->mask, true)))
                                        {
                                                // They match an entry
                                                return (char*)it->mask.c_str();