summaryrefslogtreecommitdiff
path: root/src/protocol/inspircd11.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-23 00:58:46 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-23 00:58:46 +0000
commit419b4c800209d5e4ba857c67cecfb67be7a1df2b (patch)
tree3a9182af25697193166973a2aca1d1e8b77823f8 /src/protocol/inspircd11.c
parent9123489c32e24ed7fc21c7753ca92aaece452961 (diff)
Fix odd crash bug in the inspircd* modules by replacing use of myStrGetToken with spacesepstraem, also fix a problem on Windows with not having FD_ZERO in the sgets() function before FD_SET is called, both spotted thanks to Brandan.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2126 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/inspircd11.c')
-rw-r--r--src/protocol/inspircd11.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index f27d3df0c..e95b5f795 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -15,6 +15,7 @@
#include "services.h"
#include "pseudo.h"
+#include "hashcomp.h"
#define UMODE_a 0x00000001
#define UMODE_h 0x00000002
@@ -775,9 +776,6 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
{
const char *newav[10];
- /* value used for myStrGetToken */
- int curtoken = 0;
-
/* storing the current nick */
char *curnick;
@@ -794,8 +792,11 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
if (ac < 3)
return MOD_CONT;
- curnick = myStrGetToken(av[2], ' ', curtoken);
- while (curnick != NULL) {
+ spacesepstream nicks(av[2]);
+ std::string nick;
+
+ while (nicks.GetToken(nick)) {
+ curnick = sstrdup(nick.c_str());
char *curnick_real = curnick;
for (; *curnick; curnick++) {
/* I bet theres a better way to do this... */
@@ -818,8 +819,6 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
strncat(nicklist, prefixandnick, 513);
strncat(nicklist, " ", 513);
delete [] curnick_real;
- curtoken++;
- curnick = myStrGetToken(av[2], ' ', curtoken);
nlen = 0;
}