From 830a99acb9512be2f2f056eeed4571c9467847fe Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 7 Apr 2004 21:47:31 +0000 Subject: Fixed bug where putting too many spaces in a privmsg disconnected the user git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@429 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8c3080a56..d0fa2d71b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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... -- cgit v1.3.1-10-gc9f91