]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Fixed bug where putting too many spaces in a privmsg disconnected the user
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 8c3080a563225150db75baff208e0712623cedf6..d0fa2d71be64d5a14e15c467b5529728e801ed2f 100644 (file)
@@ -4682,10 +4682,19 @@ void process_command(userrec *user, char* cmd)
        }
        
        int total_params = 0;
-       for (int q = 0; q < strlen(cmd); q++)
+       if (strlen(cmd)>2)
        {
-               if (cmd[q] == ' ')
-                       total_params++;
+               for (int q = 0; q < strlen(cmd)-1; q++)
+               {
+                       if ((cmd[q] == ' ') && (cmd[q+1] == ':'))
+                       {
+                               total_params++;
+                               // found a 'trailing', we dont count them after this.
+                               break;
+                       }
+                       if (cmd[q] == ' ')
+                               total_params++;
+               }
        }
        
        // another phidjit bug...