From 767e3b73bac9495644e45d5941e7f39427b2667d Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 25 Jan 2006 22:30:37 +0000 Subject: 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 --- src/mode.cpp | 7 ++++--- 1 file 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; } -- cgit v1.2.3