From 7456e47914b588f207a98c17a25fcdd2a8f4d176 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 30 Nov 2005 06:37:06 +0000 Subject: Removed something out of a loop that didn't belong there.. more nazi w00tie. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2025 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sajoin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 76c568ea7..f82bba203 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -31,9 +31,17 @@ void handle_sajoin(char **parameters, int pcnt, userrec *user) userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) { + /* might be nicer to make checking valid channel names an api function sometime --w00t */ + if (parameters[1][0] != '#') + { + /* we didn't need to check this for each character ;) */ + Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name"); + return; + } + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { - if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ',')) + if ((parameters[1][x] == ' ') || (parameters[1][x] == ',')) { Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name"); return; -- cgit v1.2.3