]> jfr.im git - solanum.git/blobdiff - modules/core/m_join.c
strip_tabs() is related to s_conf.c ONLY - moved it there
[solanum.git] / modules / core / m_join.c
index 1b8120a911d3b61bfc785e41730d154a1ac078ce..48c8752638d9b337203793939bc57b14bac50ce5 100644 (file)
@@ -39,7 +39,6 @@
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
-#include "sprintf_irc.h"
 #include "packet.h"
 
 static int m_join(struct Client *, struct Client *, int, const char **);
@@ -149,7 +148,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
         * this code has a side effect of losing keys, but..
         */
        chanlist = LOCAL_COPY(parv[1]);
-       for(name = strtoken(&p, chanlist, ","); name; name = strtoken(&p, NULL, ","))
+       for(name = rb_strtok_r(chanlist, ",", &p); name; name = rb_strtok_r(NULL, ",", &p))
        {
                /* check the length and name of channel is ok */
                if(!check_channel_name_loc(source_p, name) || (strlen(name) > LOC_CHANNELLEN))
@@ -205,17 +204,17 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
 
                if(*jbuf)
                        (void) strcat(jbuf, ",");
-               (void) strlcat(jbuf, name, sizeof(jbuf));
+               (void) rb_strlcat(jbuf, name, sizeof(jbuf));
        }
 
        if(parc > 2)
        {
                mykey = LOCAL_COPY(parv[2]);
-               key = strtoken(&p2, mykey, ",");
+               key = rb_strtok_r(mykey, ",", &p2);
        }
 
-       for(name = strtoken(&p, jbuf, ","); name;
-           key = (key) ? strtoken(&p2, NULL, ",") : NULL, name = strtoken(&p, NULL, ","))
+       for(name = rb_strtok_r(jbuf, ",", &p); name;
+           key = (key) ? rb_strtok_r(NULL, ",", &p2) : NULL, name = rb_strtok_r(NULL, ",", &p))
        {
                hook_data_channel_activity hook_info;
 
@@ -624,7 +623,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
                        mode.mode |= MODE_DISFORWARD;
                        break;
                case 'f':
-                       strlcpy(mode.forward, parv[4 + args], sizeof(mode.forward));
+                       rb_strlcpy(mode.forward, parv[4 + args], sizeof(mode.forward));
                        args++;
                        if(parc < 5 + args)
                                return 0;
@@ -638,7 +637,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
                                return 0;
                        break;
                case 'k':
-                       strlcpy(mode.key, parv[4 + args], sizeof(mode.key));
+                       rb_strlcpy(mode.key, parv[4 + args], sizeof(mode.key));
                        args++;
                        if(parc < 5 + args)
                                return 0;
@@ -1170,7 +1169,6 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                *mbuf++ = 'k';
                len = rb_sprintf(pbuf, "%s ", oldmode->key);
                pbuf += len;
-               pargs++;
        }
        if(oldmode->join_num && !mode->join_num)
        {
@@ -1200,7 +1198,6 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                *mbuf++ = 'l';
                len = rb_sprintf(pbuf, "%d ", mode->limit);
                pbuf += len;
-               pargs++;
        }
        if(mode->key[0] && strcmp(oldmode->key, mode->key))
        {
@@ -1212,7 +1209,6 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                *mbuf++ = 'k';
                len = rb_sprintf(pbuf, "%s ", mode->key);
                pbuf += len;
-               pargs++;
        }
        if(mode->join_num && (oldmode->join_num != mode->join_num || oldmode->join_time != mode->join_time))
        {
@@ -1224,7 +1220,6 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                *mbuf++ = 'j';
                len = rb_sprintf(pbuf, "%d:%d ", mode->join_num, mode->join_time);
                pbuf += len;
-               pargs++;
        }
        if(mode->forward[0] && strcmp(oldmode->forward, mode->forward) && ConfigChannel.use_forward)
        {
@@ -1236,7 +1231,6 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                *mbuf++ = 'f';
                len = rb_sprintf(pbuf, "%s ", mode->forward);
                pbuf += len;
-               pargs++;
        }
        *mbuf = '\0';
 }