X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/7f4fa1956ee087c272dd260feb6d7e1ef34d641b..refs/tags/shadowircd-6.2.0-beta1:/modules/m_accept.c?ds=sidebyside diff --git a/modules/m_accept.c b/modules/m_accept.c index 7fbf584..76a22ab 100644 --- a/modules/m_accept.c +++ b/modules/m_accept.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_accept.c 254 2005-09-21 23:35:12Z nenolod $ */ #include "stdinc.h" @@ -34,7 +33,6 @@ #include "send.h" #include "msg.h" #include "parse.h" -#include "sprintf_irc.h" #include "modules.h" static int m_accept(struct Client *, struct Client *, int, const char **); @@ -55,7 +53,6 @@ DECLARE_MODULE_AV1(accept, NULL, NULL, accept_clist, NULL, NULL, "$Revision: 254 /* * m_accept - ACCEPT command handler - * parv[0] = sender prefix * parv[1] = servername */ static int @@ -77,7 +74,7 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char build_nicklist(source_p, addbuf, delbuf, parv[1]); /* parse the delete list */ - for (nick = strtoken(&p, delbuf, ","); nick != NULL; nick = strtoken(&p, NULL, ",")) + for (nick = rb_strtok_r(delbuf, ",", &p); nick != NULL; nick = rb_strtok_r(NULL, ",", &p)) { /* shouldnt happen, but lets be paranoid */ if((target_p = find_named_person(nick)) == NULL) @@ -103,7 +100,7 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char accept_num = rb_dlink_list_length(&source_p->localClient->allow_list); /* parse the add list */ - for (nick = strtoken(&p, addbuf, ","); nick; nick = strtoken(&p, NULL, ",")) + for (nick = rb_strtok_r(addbuf, ",", &p); nick; nick = rb_strtok_r(NULL, ",", &p), accept_num++) { /* shouldnt happen, but lets be paranoid */ if((target_p = find_named_person(nick)) == NULL) @@ -130,7 +127,6 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char /* why is this here? */ /* del_from accept(target_p, source_p); */ add_accept(source_p, target_p); - accept_num++; } return 0; @@ -154,14 +150,13 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char * int lenadd; int lendel; int del; - struct Client *target_p; char *n = LOCAL_COPY(nicks); *addbuf = *delbuf = '\0'; del = lenadd = lendel = 0; /* build list of clients to add into addbuf, clients to remove in delbuf */ - for (name = strtoken(&p, n, ","); name; name = strtoken(&p, NULL, ","), del = 0) + for (name = rb_strtok_r(n, ",", &p); name; name = rb_strtok_r(NULL, ",", &p), del = 0) { if(*name == '-') { @@ -169,7 +164,7 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char * name++; } - if((target_p = find_named_person(name)) == NULL) + if(find_named_person(name) == NULL) { sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), name);