From ecaf40715404bdd476c970f17473078dd2acaabe Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 7 Jul 2006 21:34:46 +0000 Subject: Avoid throwing a std::out_of_range exception when given a ban without ! or @ in it (whooops) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4150 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index 729024861..e7ee1c3dc 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -603,7 +603,7 @@ void ModeParser::CleanMask(std::string &mask) * swap the two items over so that at least the n!u@h ordering * is correct even if the elements may not be */ - if (pos_of_pling > pos_of_at) + if (((pos_of_pling != std::string::npos) && (pos_of_at != std::string::npos)) && (pos_of_pling > pos_of_at)) { mask.replace(pos_of_pling, 1, "@"); mask.replace(pos_of_at, 1, "!"); -- cgit v1.2.3