diff options
Diffstat (limited to 'src/commands.cpp')
-rw-r--r-- | src/commands.cpp | 22 |
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,"")) { |