summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 02:48:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 02:48:03 +0000
commitab65aa1a5a0379af7bfd672e40875c1e50bd4d12 (patch)
tree1821be5093aca921bc4e4b0253b79e0b488d8630
parent178e92cc0b4234174309a45f9967667aea380f0a (diff)
Fixed anope module sending L tokens with 2 instead of 3 params (made code more tolerant instead of changing module)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1129 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/commands.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 266847337..5e5cf66c8 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1967,12 +1967,24 @@ void handle_m(char token,char* params,serverrec* source,serverrec* reply, char*
void handle_L(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
{
- char* nick = strtok(params," ");
- char* channel = strtok(NULL," :");
- char* reason = strtok(NULL,"\r\n");
+ char* nick = NULL;
+ char* channel = NULL;
+ char* reason = NULL;
+ if (strchr(params,':'))
+ {
+ nick = strtok(params," ");
+ channel = strtok(NULL," :");
+ reason = strtok(NULL,"\r\n");
+ reason++;
+ }
+ else
+ {
+ nick = strtok(params," ");
+ channel = strtok(NULL,"\r\n");
+ reason = "";
+ }
userrec* user = Find(nick);
- reason++;
- if (user)
+ if ((user) && (channel) && (reason))
{
if (strcmp(reason,""))
{