summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-07 21:47:31 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-07 21:47:31 +0000
commit830a99acb9512be2f2f056eeed4571c9467847fe (patch)
tree9f03a174cbdca0125cfb40b527ae9248a996e621 /src/inspircd.cpp
parent7f15d3a63f9d151bfefcd5c63594a4eba6325a44 (diff)
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
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp15
1 files changed, 12 insertions, 3 deletions
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...