From ab65aa1a5a0379af7bfd672e40875c1e50bd4d12 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 19 Apr 2005 02:48:03 +0000 Subject: 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 --- src/commands.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') 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,"")) { -- cgit v1.2.3