diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 12 | ||||
-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 | ||||
-rw-r--r-- | src/messages.c | 10 | ||||
-rw-r--r-- | src/misc.c | 4 | ||||
-rw-r--r-- | src/modules/hs_request.c | 8 |
7 files changed, 25 insertions, 31 deletions
diff --git a/src/config.c b/src/config.c index cc3dfec17..4766da1e8 100644 --- a/src/config.c +++ b/src/config.c @@ -1614,19 +1614,17 @@ int read_config(int reload) char *s; int defconCount = 0; std::list<std::pair<std::string, std::string> >::iterator it; - NickCore *nc; - std::string nick; /* Clear current opers for reload */ - for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); it++) + for (it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it) { - nick = it->first; - - if ((nc = findcore(nick.c_str()))) + std::string nick = it->first; + NickCore *nc = findcore(nick.c_str()); + if (nc) nc->ot = NULL; } svsopers_in_config.clear(); - + retval = serverConfig.Read(reload ? false : true); if (!retval) return 0; // Temporary until most of the below is modified to use the new parser -- CyberBotX 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()))) { diff --git a/src/messages.c b/src/messages.c index a29841b6a..d77b62809 100644 --- a/src/messages.c +++ b/src/messages.c @@ -216,7 +216,6 @@ int m_privmsg(const char *source, const char *receiver, const char *msg) int m_stats(const char *source, int ac, const char **av) { - int i; User *u; NickCore *nc; @@ -245,13 +244,12 @@ int m_stats(const char *source, int ac, const char **av) } else { std::list<std::pair<std::string, std::string> >::iterator it; - 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; - const std::string type = it->second; + std::string nick = it->first, type = it->second; - if ((nc = findcore(it->first.c_str()))) - ircdproto->SendNumeric(ServerName, 243, source, "O * * %s %s 0", it->first.c_str(), it->second.c_str()); + if ((nc = findcore(nick.c_str()))) + ircdproto->SendNumeric(ServerName, 243, source, "O * * %s %s 0", nick.c_str(), type.c_str()); } ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); diff --git a/src/misc.c b/src/misc.c index 02375c96b..976c26ada 100644 --- a/src/misc.c +++ b/src/misc.c @@ -112,9 +112,9 @@ char *strscpy(char *d, const char *s, size_t len) * @param s2 String 2 * @return first occurrence of s2 */ -char *stristr(char *s1, char *s2) +const char *stristr(const char *s1, const char *s2) { - register char *s = s1, *d = s2; + register const char *s = s1, *d = s2; while (*s1) { if (tolower(*s1) == tolower(*d)) { diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 71efc4c12..2a047d9b9 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -772,7 +772,7 @@ class HSRequest : public Module } }; -void my_memo_lang(User *u, char *name, int z, int number, ...) +void my_memo_lang(User *u, const char *name, int z, int number, ...) { va_list va; char buffer[4096], outbuf[4096]; @@ -832,10 +832,10 @@ void req_send_memos(User *u, char *vIdent, char *vHost) if (HSRequestMemoOper == 1) { - 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; - my_memo_lang(u, const_cast<char *>(nick.c_str()), z, LNG_REQUEST_MEMO, host); + std::string nick = it->first; + my_memo_lang(u, nick.c_str(), z, LNG_REQUEST_MEMO, host); } } if (HSRequestMemoSetters == 1) |