diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-06-11 20:28:06 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-06-11 20:28:06 +0000 |
| commit | fc78e51452a0244ee672fca91752eb7d982e2541 (patch) | |
| tree | 60f6f06b3e3acf0ad3f29a14ae7aef62fb16b1f7 /src/core | |
| parent | 8fa67528583b83a23030d5d358e070586672cc87 (diff) | |
Make stristr() const-safe, replace post-increment on iterators with pre-increment, remove now unused variables, made my_memo_lang() in hs_request.c const-safe.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2320 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/ns_group.c | 6 | ||||
| -rw-r--r-- | src/core/ns_register.c | 11 | ||||
| -rw-r--r-- | src/core/os_staff.c | 5 |
3 files changed, 10 insertions, 12 deletions
diff --git a/src/core/ns_group.c b/src/core/ns_group.c index e19a12f8e..6439b2a21 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -62,11 +62,11 @@ class CommandNSGroup : public Command if (RestrictOperNicks) { - for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); it++) + for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it) { - const std::string nick = it->first; + std::string nick = it->first; - if (stristr(u->nick, const_cast<char *>(it->first.c_str())) && !is_oper(u)) + if (stristr(u->nick, nick.c_str()) && !is_oper(u)) { notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick); return MOD_CONT; diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 5e7088a93..a9788853c 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -35,7 +35,7 @@ class CommandNSConfirm : public Command return MOD_CONT; } - int i, len; + int len; char tsbuf[16]; char tmp_pass[PASSMAX]; char modes[512]; @@ -202,14 +202,13 @@ class CommandNSRegister : public CommandNSConfirm CommandReturn Execute(User *u, std::vector<std::string> ¶ms) { NickRequest *nr = NULL, *anr = NULL; - NickCore *nc = NULL; NickAlias *na; int prefixlen = strlen(NSGuestNickPrefix); int nicklen = strlen(u->nick); const char *pass = params[0].c_str(); const char *email = params.size() > 1 ? params[1].c_str() : NULL; char passcode[11]; - int idx, min = 1, max = 62, i = 0; + int idx, min = 1, max = 62; int chars[] = { ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', @@ -262,11 +261,11 @@ class CommandNSRegister : public CommandNSConfirm if (RestrictOperNicks) { - for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); it++) + for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it) { - const std::string nick = it->first; + std::string nick = it->first; - if (stristr(u->nick, const_cast<char *>(it->first.c_str())) && !is_oper(u)) + if (stristr(u->nick, nick.c_str()) && !is_oper(u)) { notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick); return MOD_CONT; diff --git a/src/core/os_staff.c b/src/core/os_staff.c index 28de7768a..476b072c5 100644 --- a/src/core/os_staff.c +++ b/src/core/os_staff.c @@ -36,11 +36,10 @@ class CommandOSStaff : public Command notice_lang(s_OperServ, u, OPER_STAFF_LIST_HEADER); - for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); it++) + for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it) { found = 0; - const std::string nick = it->first; - const std::string type = it->second; + std::string nick = it->first, type = it->second; if ((au = finduser(nick.c_str()))) { |
