diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-25 22:30:37 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-25 22:30:37 +0000 |
commit | 767e3b73bac9495644e45d5941e7f39427b2667d (patch) | |
tree | a6794a63d17c8e039ee6a314a583a676757904bb /src | |
parent | 93af9b93f3790b1ca3a570e9715afe6a9304d536 (diff) |
Changed +l to drop the mode if the limit is same as current.
Optimized check on numeric chars
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2908 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index c70f4f26a..16d7322ec 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -797,14 +797,15 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int break; previously_set_l = true; bool invalid = false; - for (unsigned int i = 0; i < strlen(parameters[param]); i++) + for (char* f = parameters[param]; *f; f++) { - if ((parameters[param][i] < '0') || (parameters[param][i] > '9')) + if ((*f < '0') || (*f > '9')) { invalid = true; } } - if (atoi(parameters[param]) < 1) + /* If the limit is < 1, or the new limit is the current limit, dont allow */ + if ((atoi(parameters[param]) < 1) || ((chan->limit > 0) && (atoi(parameters[param]) == chan->limit))) { invalid = true; } |