]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Advanced to RC1
[user/henk/code/inspircd.git] / src / channels.cpp
index d1bb4b8a3095f57aa4b2c1ba22d09ae6800234af..0201ec7b4fc1f80a072598c980d01b0af8813dc0 100644 (file)
@@ -19,7 +19,6 @@ using namespace std;
 #include "inspircd_config.h"
 #include "inspircd.h"
 #include "inspircd_io.h"
-#include "inspircd_util.h"
 #include <unistd.h>
 #include <sys/errno.h>
 #include <sys/ioctl.h>
@@ -73,13 +72,8 @@ chanrec* ForceChan(chanrec* Ptr,ucrec &a,userrec* user, int created);
 
 chanrec::chanrec()
 {
-       strcpy(name,"");
-       strcpy(custom_modes,"");
-       strcpy(topic,"");
-       strcpy(setby,"");
-       strcpy(key,"");
-       created = topicset = limit = 0;
-       binarymodes = 0;
+       *name = *custom_modes = *topic = *setby = *key = 0;
+       created = topicset = limit = binarymodes = 0;
        internal_userlist.clear();
 }
 
@@ -223,7 +217,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                 strlcpy(chanlist[cname]->name, cname,CHANMAX);
                 chanlist[cname]->binarymodes = CM_TOPICLOCK | CM_NOEXTERNAL;
                 chanlist[cname]->created = TIME;
-                strcpy(chanlist[cname]->topic, "");
+                *chanlist[cname]->topic = 0;
                 strncpy(chanlist[cname]->setby, user->nick,NICKMAX);
                 chanlist[cname]->topicset = 0;
                 Ptr = chanlist[cname];
@@ -276,12 +270,13 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                                 }
                                 if (Ptr->binarymodes & CM_INVITEONLY)
                                 {
-                                        MOD_RESULT = 0;
+                                       MOD_RESULT = 0;
+                                       irc::string xname(Ptr->name);
                                         FOREACH_RESULT(OnCheckInvite(user, Ptr));
                                         if (!MOD_RESULT)
                                         {
                                                 log(DEBUG,"add_channel: channel is +i");
-                                                if (user->IsInvited(Ptr->name))
+                                                if (user->IsInvited(xname))
                                                 {
                                                         /* user was invited to channel */
                                                         /* there may be an optional channel NOTICE here */
@@ -292,7 +287,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                                                         return NULL;
                                                 }
                                         }
-                                        user->RemoveInvite(Ptr->name);
+                                        user->RemoveInvite(xname);
                                 }
                                 if (Ptr->limit)
                                 {