diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 12:18:29 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 12:18:29 +0000 |
commit | 0757a4a495daabf661ac3b7ab79f0a5ee423abe8 (patch) | |
tree | d788af6cee694ae3b623bbfbbc31864de43b9d12 /src | |
parent | 80d1296c31d8e16e71f7079144618a3eae6976d1 (diff) |
mass tidyup, change A LOT of stuff to const char** which was char** (such as parameters to commands in handlers)
which makes the new lineparser work neater with no casts. This also removes tons of casts from other locations
(all in all, ive added 2 casts and removed almost a hundred)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4403 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
105 files changed, 172 insertions, 186 deletions
diff --git a/src/cmd_admin.cpp b/src/cmd_admin.cpp index 8ca05a523..48b237e64 100644 --- a/src/cmd_admin.cpp +++ b/src/cmd_admin.cpp @@ -22,7 +22,7 @@ extern ServerConfig* Config; -void cmd_admin::Handle (char **parameters, int pcnt, userrec *user) +void cmd_admin::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"256 %s :Administrative info for %s",user->nick,Config->ServerName); WriteServ(user->fd,"257 %s :Name - %s",user->nick,Config->AdminName); diff --git a/src/cmd_away.cpp b/src/cmd_away.cpp index f882904c2..86e5559f3 100644 --- a/src/cmd_away.cpp +++ b/src/cmd_away.cpp @@ -30,7 +30,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; -void cmd_away::Handle (char **parameters, int pcnt, userrec *user) +void cmd_away::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt) { diff --git a/src/cmd_commands.cpp b/src/cmd_commands.cpp index 57f142207..257413c11 100644 --- a/src/cmd_commands.cpp +++ b/src/cmd_commands.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_commands::Handle (char **parameters, int pcnt, userrec *user) +void cmd_commands::Handle (const char** parameters, int pcnt, userrec *user) { for (nspace::hash_map<std::string,command_t*>::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++) { diff --git a/src/cmd_connect.cpp b/src/cmd_connect.cpp index 978478e3a..affeb9317 100644 --- a/src/cmd_connect.cpp +++ b/src/cmd_connect.cpp @@ -22,7 +22,7 @@ /* * This is handled by the server linking module, if necessary. Do not remove this stub. */ -void cmd_connect::Handle (char **parameters, int pcnt, userrec *user) +void cmd_connect::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd, "NOTICE %s :You are a nub. Load a linking module.", user->nick); } diff --git a/src/cmd_die.cpp b/src/cmd_die.cpp index 494eba0c5..3e3d63f3e 100644 --- a/src/cmd_die.cpp +++ b/src/cmd_die.cpp @@ -26,7 +26,7 @@ extern ServerConfig* Config; extern std::vector<userrec*> all_opers; -void cmd_die::Handle (char **parameters, int pcnt, userrec *user) +void cmd_die::Handle (const char** parameters, int pcnt, userrec *user) { if (!strcmp(parameters[0],Config->diepass)) { diff --git a/src/cmd_eline.cpp b/src/cmd_eline.cpp index cf5e13414..70d07236a 100644 --- a/src/cmd_eline.cpp +++ b/src/cmd_eline.cpp @@ -29,7 +29,7 @@ extern ServerConfig* Config; extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; -void cmd_eline::Handle (char **parameters, int pcnt, userrec *user) +void cmd_eline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { diff --git a/src/cmd_gline.cpp b/src/cmd_gline.cpp index 2733178cf..201683541 100644 --- a/src/cmd_gline.cpp +++ b/src/cmd_gline.cpp @@ -29,7 +29,7 @@ extern int MODCOUNT; extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; -void cmd_gline::Handle (char **parameters, int pcnt, userrec *user) +void cmd_gline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { diff --git a/src/cmd_info.cpp b/src/cmd_info.cpp index 963d6a1b1..d33b678a4 100644 --- a/src/cmd_info.cpp +++ b/src/cmd_info.cpp @@ -26,7 +26,7 @@ extern int MODCOUNT; extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; -void cmd_info::Handle (char **parameters, int pcnt, userrec *user) +void cmd_info::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd, "371 %s :. o O (The Inspire Internet Relay Chat Server) O o .", user->nick); WriteServ(user->fd, "371 %s : ", user->nick); diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp index 0eaafe211..f452f215b 100644 --- a/src/cmd_invite.cpp +++ b/src/cmd_invite.cpp @@ -28,7 +28,7 @@ extern int MODCOUNT; extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; -void cmd_invite::Handle (char **parameters, int pcnt, userrec *user) +void cmd_invite::Handle (const char** parameters, int pcnt, userrec *user) { int MOD_RESULT = 0; diff --git a/src/cmd_ison.cpp b/src/cmd_ison.cpp index 4c840c748..099d6acd6 100644 --- a/src/cmd_ison.cpp +++ b/src/cmd_ison.cpp @@ -21,7 +21,7 @@ #include "helperfuncs.h" #include "commands/cmd_ison.h" -void cmd_ison::Handle (char **parameters, int pcnt, userrec *user) +void cmd_ison::Handle (const char** parameters, int pcnt, userrec *user) { char retbuf[MAXBUF]; userrec *u; diff --git a/src/cmd_join.cpp b/src/cmd_join.cpp index 17b14fdff..fc63283e5 100644 --- a/src/cmd_join.cpp +++ b/src/cmd_join.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_join::Handle (char **parameters, int pcnt, userrec *user) +void cmd_join::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->Parser->LoopCall(this, parameters, pcnt, user, 0, 0, 1)) return; diff --git a/src/cmd_kick.cpp b/src/cmd_kick.cpp index 29e0860e0..4743f47df 100644 --- a/src/cmd_kick.cpp +++ b/src/cmd_kick.cpp @@ -20,7 +20,7 @@ #include "helperfuncs.h" #include "commands/cmd_kick.h" -void cmd_kick::Handle (char **parameters, int pcnt, userrec *user) +void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) { char reason[MAXKICK]; chanrec* c = FindChan(parameters[0]); diff --git a/src/cmd_kill.cpp b/src/cmd_kill.cpp index cbdf5b9be..ba9ac9dc7 100644 --- a/src/cmd_kill.cpp +++ b/src/cmd_kill.cpp @@ -30,7 +30,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern user_hash clientlist; -void cmd_kill::Handle (char **parameters, int pcnt, userrec *user) +void cmd_kill::Handle (const char** parameters, int pcnt, userrec *user) { userrec *u = Find(parameters[0]); char killreason[MAXBUF]; diff --git a/src/cmd_kline.cpp b/src/cmd_kline.cpp index e84112959..89f051f5e 100644 --- a/src/cmd_kline.cpp +++ b/src/cmd_kline.cpp @@ -37,7 +37,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern time_t TIME; -void cmd_kline::Handle (char **parameters, int pcnt, userrec *user) +void cmd_kline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { diff --git a/src/cmd_links.cpp b/src/cmd_links.cpp index bf672a714..57df3b4fb 100644 --- a/src/cmd_links.cpp +++ b/src/cmd_links.cpp @@ -24,7 +24,7 @@ extern ServerConfig* Config; -void cmd_links::Handle (char **parameters, int pcnt, userrec *user) +void cmd_links::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"364 %s %s %s :0 %s",user->nick,Config->ServerName,Config->ServerName,Config->ServerDesc); WriteServ(user->fd,"365 %s * :End of /LINKS list.",user->nick); diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp index 211c88d1f..9d1a96fc9 100644 --- a/src/cmd_list.cpp +++ b/src/cmd_list.cpp @@ -22,7 +22,7 @@ extern chan_hash chanlist; -void cmd_list::Handle (char **parameters, int pcnt, userrec *user) +void cmd_list::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"321 %s Channel :Users Name",user->nick); for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++) diff --git a/src/cmd_loadmodule.cpp b/src/cmd_loadmodule.cpp index e06817624..5b91746ab 100644 --- a/src/cmd_loadmodule.cpp +++ b/src/cmd_loadmodule.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_loadmodule::Handle (char **parameters, int pcnt, userrec *user) +void cmd_loadmodule::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->LoadModule(parameters[0])) { diff --git a/src/cmd_lusers.cpp b/src/cmd_lusers.cpp index 0405145e2..3b1decea3 100644 --- a/src/cmd_lusers.cpp +++ b/src/cmd_lusers.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_lusers.h" -void cmd_lusers::Handle (char **parameters, int pcnt, userrec *user) +void cmd_lusers::Handle (const char** parameters, int pcnt, userrec *user) { // this lusers command shows one server at all times because // a protocol module must override it to show those stats. diff --git a/src/cmd_map.cpp b/src/cmd_map.cpp index dcf598662..9807d0d77 100644 --- a/src/cmd_map.cpp +++ b/src/cmd_map.cpp @@ -23,7 +23,7 @@ extern ServerConfig* Config; -void cmd_map::Handle (char **parameters, int pcnt, userrec *user) +void cmd_map::Handle (const char** parameters, int pcnt, userrec *user) { // as with /LUSERS this does nothing without a linking // module to override its behaviour and display something diff --git a/src/cmd_modules.cpp b/src/cmd_modules.cpp index 60ba1fa25..dbf7efee4 100644 --- a/src/cmd_modules.cpp +++ b/src/cmd_modules.cpp @@ -51,7 +51,7 @@ char* itab[] = { "OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", NULL }; -void cmd_modules::Handle (char **parameters, int pcnt, userrec *user) +void cmd_modules::Handle (const char** parameters, int pcnt, userrec *user) { for (unsigned int i = 0; i < Config->module_names.size(); i++) { diff --git a/src/cmd_motd.cpp b/src/cmd_motd.cpp index 2efd8d55b..a8cee2727 100644 --- a/src/cmd_motd.cpp +++ b/src/cmd_motd.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_motd.h" -void cmd_motd::Handle (char **parameters, int pcnt, userrec *user) +void cmd_motd::Handle (const char** parameters, int pcnt, userrec *user) { ShowMOTD(user); } diff --git a/src/cmd_names.cpp b/src/cmd_names.cpp index 7857449f2..d25e7c5e6 100644 --- a/src/cmd_names.cpp +++ b/src/cmd_names.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_names::Handle (char **parameters, int pcnt, userrec *user) +void cmd_names::Handle (const char** parameters, int pcnt, userrec *user) { chanrec* c; diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index 3eeb37663..bfaddda23 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -35,7 +35,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern time_t TIME; -void cmd_nick::Handle (char **parameters, int pcnt, userrec *user) +void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) { char oldnick[NICKMAX]; diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index 5c745f74a..434594df9 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -36,7 +36,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern time_t TIME; -void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) +void cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) { userrec *dest; chanrec *chan; @@ -48,8 +48,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server)))) { // notice to server mask - char* servermask = parameters[0]; - servermask++; + const char* servermask = parameters[0] + 1; if (match(Config->ServerName,servermask)) { NoticeAll(user, true, "%s",parameters[1]); diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp index 4f0a31d01..e05736eda 100644 --- a/src/cmd_oper.cpp +++ b/src/cmd_oper.cpp @@ -59,7 +59,7 @@ bool OneOfMatches(const char* host, const char* hostlist) return false; } -void cmd_oper::Handle (char **parameters, int pcnt, userrec *user) +void cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) { char LoginName[MAXBUF]; char Password[MAXBUF]; diff --git a/src/cmd_part.cpp b/src/cmd_part.cpp index 70a5511eb..44c158205 100644 --- a/src/cmd_part.cpp +++ b/src/cmd_part.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_part::Handle (char **parameters, int pcnt, userrec *user) +void cmd_part::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt > 1) { diff --git a/src/cmd_pass.cpp b/src/cmd_pass.cpp index 76d5f08cb..0f3665222 100644 --- a/src/cmd_pass.cpp +++ b/src/cmd_pass.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_pass.h" -void cmd_pass::Handle (char **parameters, int pcnt, userrec *user) +void cmd_pass::Handle (const char** parameters, int pcnt, userrec *user) { // Check to make sure they havnt registered -- Fix by FCS if (user->registered == 7) diff --git a/src/cmd_ping.cpp b/src/cmd_ping.cpp index 01d0e021b..b30a9d0fa 100644 --- a/src/cmd_ping.cpp +++ b/src/cmd_ping.cpp @@ -23,7 +23,7 @@ extern ServerConfig* Config; -void cmd_ping::Handle (char **parameters, int pcnt, userrec *user) +void cmd_ping::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"PONG %s :%s",Config->ServerName,parameters[0]); } diff --git a/src/cmd_pong.cpp b/src/cmd_pong.cpp index 76acfbccd..cf86b5b53 100644 --- a/src/cmd_pong.cpp +++ b/src/cmd_pong.cpp @@ -19,7 +19,7 @@ #include "commands/cmd_pong.h" #include "helperfuncs.h" -void cmd_pong::Handle (char **parameters, int pcnt, userrec *user) +void cmd_pong::Handle (const char** parameters, int pcnt, userrec *user) { // set the user as alive so they survive to next ping user->lastping = 1; diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index 81e5ee016..e74495bb6 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -33,7 +33,7 @@ extern ModuleList modules; extern FactoryList factory; extern time_t TIME; -void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user) +void cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) { userrec *dest; chanrec *chan; @@ -45,8 +45,7 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user) if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server)))) { // notice to server mask - char* servermask = parameters[0]; - servermask++; + const char* servermask = parameters[0] + 1; if (match(Config->ServerName,servermask)) { ServerPrivmsgAll("%s",parameters[1]); diff --git a/src/cmd_qline.cpp b/src/cmd_qline.cpp index 895efba83..6f7570485 100644 --- a/src/cmd_qline.cpp +++ b/src/cmd_qline.cpp @@ -28,7 +28,7 @@ extern int MODCOUNT; extern ModuleList modules; extern FactoryList factory; -void cmd_qline::Handle (char **parameters, int pcnt, userrec *user) +void cmd_qline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp index 7c0b602e9..5011d230e 100644 --- a/src/cmd_quit.cpp +++ b/src/cmd_quit.cpp @@ -47,10 +47,10 @@ extern chan_hash chanlist; extern std::vector<userrec*> local_users; extern userrec* fd_ref_table[MAX_DESCRIPTORS]; -void cmd_quit::Handle (char **parameters, int pcnt, userrec *user) +void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) { user_hash::iterator iter = clientlist.find(user->nick); - char* reason; + char reason[MAXBUF]; if (user->registered == 7) { @@ -60,10 +60,7 @@ void cmd_quit::Handle (char **parameters, int pcnt, userrec *user) if (*parameters[0] == ':') parameters[0]++; - reason = parameters[0]; - - if (strlen(reason) > MAXQUIT) - reason[MAXQUIT-1] = 0; + strlcpy(reason, parameters[0],MAXQUIT-1); /* We should only prefix the quit for a local user. Remote users have * already been prefixed, where neccessary, by the upstream server. diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp index 5ea852ba8..f01a9b04e 100644 --- a/src/cmd_rehash.cpp +++ b/src/cmd_rehash.cpp @@ -27,7 +27,7 @@ extern int MODCOUNT; extern ModuleList modules; extern FactoryList factory; -void cmd_rehash::Handle (char **parameters, int pcnt, userrec *user) +void cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CleanFilename(CONFIG_FILE)); std::string parameter = ""; diff --git a/src/cmd_restart.cpp b/src/cmd_restart.cpp index 80f607890..2b8a7fc3f 100644 --- a/src/cmd_restart.cpp +++ b/src/cmd_restart.cpp @@ -22,7 +22,7 @@ extern ServerConfig* Config;; -void cmd_restart::Handle (char **parameters, int pcnt, userrec *user) +void cmd_restart::Handle (const char** parameters, int pcnt, userrec *user) { char *argv[32]; log(DEFAULT,"Restart: %s",user->nick); diff --git a/src/cmd_rules.cpp b/src/cmd_rules.cpp index 4cb1e3c0b..85e2eadf1 100644 --- a/src/cmd_rules.cpp +++ b/src/cmd_rules.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_rules.h" -void cmd_rules::Handle (char **parameters, int pcnt, userrec *user) +void cmd_rules::Handle (const char** parameters, int pcnt, userrec *user) { ShowRULES(user); } diff --git a/src/cmd_server.cpp b/src/cmd_server.cpp index 4ab00b52e..367c8febc 100644 --- a/src/cmd_server.cpp +++ b/src/cmd_server.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_server.h" -void cmd_server::Handle (char **parameters, int pcnt, userrec *user) +void cmd_server::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"666 %s :You cannot identify as a server, you are a USER. IRC Operators informed.",user->nick); WriteOpers("*** WARNING: %s attempted to issue a SERVER command and is registered as a user!",user->nick); diff --git a/src/cmd_squit.cpp b/src/cmd_squit.cpp index 7b080a0ec..08dee1188 100644 --- a/src/cmd_squit.cpp +++ b/src/cmd_squit.cpp @@ -22,7 +22,7 @@ /* * This is handled by the server linking module, if necessary. Do not remove this stub. */ -void cmd_squit::Handle (char **parameters, int pcnt, userrec *user) +void cmd_squit::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd, "NOTICE %s :You are a nub. Load a linking module.", user->nick); } diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 20c573f87..124bdb7a3 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -52,17 +52,12 @@ extern time_t TIME; extern user_hash clientlist; extern chan_hash chanlist; -void cmd_stats::Handle (char **parameters, int pcnt, userrec *user) +void cmd_stats::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt != 1) { return; } - if (parameters[0][1]) - { - /* make the stats query 1 character long */ - parameters[0][1] = 0; - } if ((*Config->OperOnlyStats) && (strchr(Config->OperOnlyStats,*parameters[0])) && (!*user->oper)) { diff --git a/src/cmd_summon.cpp b/src/cmd_summon.cpp index ff1659263..c323e2e3c 100644 --- a/src/cmd_summon.cpp +++ b/src/cmd_summon.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_summon.h" -void cmd_summon::Handle (char **parameters, int pcnt, userrec *user) +void cmd_summon::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"445 %s :SUMMON has been disabled (depreciated command)",user->nick); } diff --git a/src/cmd_time.cpp b/src/cmd_time.cpp index 3eaa99ec7..53d06ddca 100644 --- a/src/cmd_time.cpp +++ b/src/cmd_time.cpp @@ -24,7 +24,7 @@ extern ServerConfig* Config; extern time_t TIME; -void cmd_time::Handle (char **parameters, int pcnt, userrec *user) +void cmd_time::Handle (const char** parameters, int pcnt, userrec *user) { struct tm* timeinfo; diff --git a/src/cmd_topic.cpp b/src/cmd_topic.cpp index 191cecb0f..4bfa608b4 100644 --- a/src/cmd_topic.cpp +++ b/src/cmd_topic.cpp @@ -29,7 +29,7 @@ extern time_t TIME; extern ModuleList modules; extern FactoryList factory; -void cmd_topic::Handle (char **parameters, int pcnt, userrec *user) +void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user) { chanrec* Ptr; diff --git a/src/cmd_trace.cpp b/src/cmd_trace.cpp index 1af42c2e6..c2c298d29 100644 --- a/src/cmd_trace.cpp +++ b/src/cmd_trace.cpp @@ -21,7 +21,7 @@ extern user_hash clientlist; -void cmd_trace::Handle (char **parameters, int pcnt, userrec *user) +void cmd_trace::Handle (const char** parameters, int pcnt, userrec *user) { for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++) { diff --git a/src/cmd_unloadmodule.cpp b/src/cmd_unloadmodule.cpp index 35db537d0..44701d63d 100644 --- a/src/cmd_unloadmodule.cpp +++ b/src/cmd_unloadmodule.cpp @@ -22,7 +22,7 @@ extern InspIRCd* ServerInstance; -void cmd_unloadmodule::Handle (char **parameters, int pcnt, userrec *user) +void cmd_unloadmodule::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->UnloadModule(parameters[0])) { diff --git a/src/cmd_user.cpp b/src/cmd_user.cpp index 97466bce4..f493f76c1 100644 --- a/src/cmd_user.cpp +++ b/src/cmd_user.cpp @@ -27,7 +27,7 @@ extern int MODCOUNT; extern ModuleList modules; extern FactoryList factory; -void cmd_user::Handle (char **parameters, int pcnt, userrec *user) +void cmd_user::Handle (const char** parameters, int pcnt, userrec *user) { if (user->registered < 3) { diff --git a/src/cmd_userhost.cpp b/src/cmd_userhost.cpp index 266d5369c..977c67667 100644 --- a/src/cmd_userhost.cpp +++ b/src/cmd_userhost.cpp @@ -20,7 +20,7 @@ #include "helperfuncs.h" #include "commands/cmd_userhost.h" -void cmd_userhost::Handle (char **parameters, int pcnt, userrec *user) +void cmd_userhost::Handle (const char** parameters, int pcnt, userrec *user) { char Return[MAXBUF],junk[MAXBUF]; snprintf(Return,MAXBUF,"302 %s :",user->nick); diff --git a/src/cmd_users.cpp b/src/cmd_users.cpp index 8286a675f..3d8b7519d 100644 --- a/src/cmd_users.cpp +++ b/src/cmd_users.cpp @@ -19,7 +19,7 @@ #include "helperfuncs.h" #include "commands/cmd_users.h" -void cmd_users::Handle (char **parameters, int pcnt, userrec *user) +void cmd_users::Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"445 %s :USERS has been disabled (depreciated command)",user->nick); } diff --git a/src/cmd_version.cpp b/src/cmd_version.cpp index 5718f8e8a..b82809a5a 100644 --- a/src/cmd_version.cpp +++ b/src/cmd_version.cpp @@ -24,7 +24,7 @@ extern ServerConfig* Config; extern InspIRCd* ServerInstance; -void cmd_version::Handle (char **parameters, int pcnt, userrec *user) +void cmd_version::Handle (const char** parameters, int pcnt, userrec *user) { std::stringstream out(Config->data005); std::string token = ""; diff --git a/src/cmd_wallops.cpp b/src/cmd_wallops.cpp index f7d385341..453ce911d 100644 --- a/src/cmd_wallops.cpp +++ b/src/cmd_wallops.cpp @@ -25,7 +25,7 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern ServerConfig* Config; -void cmd_wallops::Handle (char **parameters, int pcnt, userrec *user) +void cmd_wallops::Handle (const char** parameters, int pcnt, userrec *user) { WriteWallOps(user,false,"%s",parameters[0]); FOREACH_MOD(I_OnWallops,OnWallops(user,parameters[0])); diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp index 4697add4e..96add6afc 100644 --- a/src/cmd_who.cpp +++ b/src/cmd_who.cpp @@ -27,7 +27,7 @@ extern user_hash clientlist; extern chan_hash chanlist; extern std::vector<userrec*> all_opers; -void cmd_who::Handle (char **parameters, int pcnt, userrec *user) +void cmd_who::Handle (const char** parameters, int pcnt, userrec *user) { chanrec* Ptr = NULL; char tmp[10]; diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp index 138589237..e44757e6d 100644 --- a/src/cmd_whois.cpp +++ b/src/cmd_whois.cpp @@ -101,7 +101,7 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i } } -void cmd_whois::Handle (char **parameters, int pcnt, userrec *user) +void cmd_whois::Handle (const char** parameters, int pcnt, userrec *user) { userrec *dest; if (ServerInstance->Parser->LoopCall(this,parameters,pcnt,user,0,pcnt-1,0)) diff --git a/src/cmd_whowas.cpp b/src/cmd_whowas.cpp index d584d51cb..9d93517fe 100644 --- a/src/cmd_whowas.cpp +++ b/src/cmd_whowas.cpp @@ -24,7 +24,7 @@ extern ServerConfig* Config; extern whowas_users whowas; -void cmd_whowas::Handle (char **parameters, int pcnt, userrec* user) +void cmd_whowas::Handle (const char** parameters, int pcnt, userrec* user) { whowas_users::iterator i = whowas.find(parameters[0]); diff --git a/src/cmd_zline.cpp b/src/cmd_zline.cpp index 607d81bfb..637ff71a9 100644 --- a/src/cmd_zline.cpp +++ b/src/cmd_zline.cpp @@ -29,7 +29,7 @@ extern int MODCOUNT; extern ModuleList modules; extern FactoryList factory; -void cmd_zline::Handle (char **parameters, int pcnt, userrec *user) +void cmd_zline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 19729d9e4..f27467f34 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -98,7 +98,7 @@ cmd_pass* command_pass; * before the actual list as well. This code is used by many functions which * can function as "one to list" (see the RFC) */ -int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins) +int CommandParser::LoopCall(command_t* fn, const char** parameters, int pcnt, userrec *u, int start, int end, int joins) { /* Copy of the parameter list, because like strltok, we make a bit of * a mess of the parameter string we're given, and we want to keep this @@ -110,13 +110,13 @@ int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec char *param; /* Parameter list, we can have up to 32 of these */ - char *pars[32]; + const char *pars[32]; /* Seperated items, e.g. holds the #one and #two from "#one,#two" */ - char *sep_items[32]; + const char *sep_items[32]; /* Seperated keys, holds the 'two' and 'three' of "two,three" */ - char *sep_keys[32]; + const char *sep_keys[32]; /* Misc. counters, the total values hold the total number of * seperated items in sep_items (total) and the total number of * seperated items in sep_keys (total2) @@ -316,7 +316,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use // calls a handler function for a command -bool CommandParser::CallHandler(const std::string &commandname,char **parameters, int pcnt, userrec *user) +bool CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user) { nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname); @@ -347,15 +347,14 @@ bool CommandParser::CallHandler(const std::string &commandname,char **parameters void CommandParser::ProcessCommand(userrec *user, std::string &cmd) { - char *command_p[127]; + const char *command_p[127]; int items = 0; - std::string para[127]; irc::tokenstream tokens(cmd); std::string xcommand = tokens.GetToken(); - while ((para[items] = tokens.GetToken()) != "") - command_p[items] = (char*)para[items++].c_str(); + while (((para[items] = tokens.GetToken()) != "") && (items < 127)) + command_p[items] = para[items++].c_str(); int MOD_RESULT = 0; FOREACH_RESULT(I_OnPreCommand,OnPreCommand(xcommand,command_p,items,user,false)); diff --git a/src/commands.cpp b/src/commands.cpp index e4fc939ea..a10842ab1 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -127,7 +127,7 @@ bool is_uline(const char* server) return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end()); } -int operstrcmp(char* data,char* input) +int operstrcmp(const char* data,const char* input) { int MOD_RESULT = 0; FOREACH_RESULT(I_OnOperCompare,OnOperCompare(data,input)) diff --git a/src/mode.cpp b/src/mode.cpp index 791d0f897..86b0024c0 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -255,7 +255,7 @@ void ModeParser::DisplayCurrentModes(userrec *user, userrec* targetuser, chanrec return; } -void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool servermode) +void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool servermode) { std::string target = parameters[0]; ModeType type = MODETYPE_USER; @@ -314,7 +314,7 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server */ if ((type== MODETYPE_CHANNEL) && (pcnt == 2)) { - char* mode = parameters[1]; + const char* mode = parameters[1]; if (*mode == '+') mode++; @@ -482,7 +482,7 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server } -void cmd_mode::Handle (char **parameters, int pcnt, userrec *user) +void cmd_mode::Handle (const char** parameters, int pcnt, userrec *user) { if (!user) return; diff --git a/src/modules.cpp b/src/modules.cpp index 7214a9673..ca533b523 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -152,7 +152,7 @@ int Module::OnKill(userrec* source, userrec* dest, const std::string &reason) { void Module::OnLoadModule(Module* mod,const std::string &name) { }; void Module::OnUnloadModule(Module* mod,const std::string &name) { }; void Module::OnBackgroundTimer(time_t curtime) { }; -int Module::OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) { return 0; }; +int Module::OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { return 0; }; bool Module::OnCheckReady(userrec* user) { return true; }; void Module::OnUserRegister(userrec* user) { }; int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { return 0; }; @@ -423,7 +423,7 @@ bool Server::IsUlined(const std::string &server) return is_uline(server.c_str()); } -bool Server::CallCommandHandler(const std::string &commandname, char** parameters, int pcnt, userrec* user) +bool Server::CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user) { return ServerInstance->Parser->CallHandler(commandname,parameters,pcnt,user); } @@ -447,7 +447,7 @@ void Server::AddCommand(command_t *f) } } -void Server::SendMode(char **parameters, int pcnt, userrec *user) +void Server::SendMode(const char** parameters, int pcnt, userrec *user) { //ServerInstance->ModeGrok->ServerMode(parameters,pcnt,user); } diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 84dd8fa43..7fd68ab75 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -227,7 +227,7 @@ class ModuleSQLLog : public Module return 0; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { if ((command == "GLINE") || (command == "KLINE") || (command == "ELINE") || (command == "ZLINE")) { diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index f39be098c..acbdef60a 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -82,7 +82,7 @@ class ModuleSQLOper : public Module List[I_OnRehash] = List[I_OnPreCommand] = 1; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { if ((command == "OPER") && (validated)) { diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index d218777af..869bc6a1f 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -87,7 +87,7 @@ class ModuleAlias : public Module return Version(1,0,0,1,VF_VENDOR); } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { userrec *u = NULL; irc::string c = command.c_str(); @@ -137,9 +137,9 @@ class ModuleAlias : public Module stuff >> cmd; stuff >> target; - char* para[2]; - para[0] = (char*)target.c_str(); - para[1] = (char*)n.c_str(); + const char* para[2]; + para[0] = target.c_str(); + para[1] = n.c_str(); Srv->CallCommandHandler(cmd,para,2,user); return 1; diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 24b3deb85..0ddaddd34 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -94,7 +94,7 @@ public: DELETE(Conf); } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { // Don't do anything with unregistered users, or remote ones. if(!user || (user->registered != 7) || !IS_LOCAL(user)) @@ -117,7 +117,7 @@ public: if(*parameters[0] != '#') targets--; - for(char* c = parameters[0]; *c; c++) + for(const char* c = parameters[0]; *c; c++) if((*c == ',') && *(c+1) && (*(c+1) == '#')) targets++; diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 10e71df7b..57bb9490a 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -68,7 +68,7 @@ class cmd_cban : public command_t this->Srv = Me; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 5e7b4847c..7f5dc793d 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -39,7 +39,7 @@ class cmd_check : public command_t this->source = "m_check.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec *targuser; chanrec *targchan; diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 1a547f548..8113cc19d 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -35,9 +35,9 @@ class cmd_chghost : public command_t this->source = "m_chghost.so"; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { - char * x = parameters[1]; + const char * x = parameters[1]; for (; *x; x++) { diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 1f7c28dda..f2c48cb52 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -16,7 +16,7 @@ class cmd_chgident : public command_t Srv = serv; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { userrec* dest = Srv->FindNick(std::string(parameters[0])); diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 99898259a..ab13708ea 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -432,7 +432,7 @@ class ModuleCloaking : public Module // SAMODE in unreal. Note that to the user it will appear as if they set // the mode on themselves. - char* modes[2]; // only two parameters + const char* modes[2]; // only two parameters modes[0] = user->nick; // first parameter is the nick modes[1] = "+x"; // second parameter is the mode Srv->SendMode(modes,2,user); // send these, forming the command "MODE <nick> +x" diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 353bd763f..a97fe8d3f 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -76,7 +76,7 @@ class ModuleWaitPong : public Module user->Extend("waitpong_pingstr", pingrpl); } - virtual int OnPreCommand(const std::string &command, char** parameters, int pcnt, userrec* user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec* user, bool validated) { if(command == "PONG") { diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 12257d520..214de5783 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -38,7 +38,7 @@ class cmd_devoice : public command_t this->source = "m_devoice.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { /* * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send @@ -46,7 +46,7 @@ class cmd_devoice : public command_t * * - I'm not aware what checking I need, so for now... be supreme evil. */ - char* modes[3]; + const char* modes[3]; modes[0] = parameters[0]; modes[1] = "-v"; modes[2] = user->nick; diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 1cb14ba83..229a77256 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -35,7 +35,7 @@ class cmd_gloadmodule : public command_t this->source = "m_globalload.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->LoadModule(parameters[0])) { @@ -57,7 +57,7 @@ class cmd_gunloadmodule : public command_t this->source = "m_globalload.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->UnloadModule(parameters[0])) { diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index add0306a7..6d00d5889 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -37,7 +37,7 @@ class cmd_globops : public command_t this->source = "m_globops.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { std::string line = "*** GLOBOPS - From " + std::string(user->nick) + ": "; for (int i = 0; i < pcnt; i++) diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 9c21201d8..c1457765d 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -25,8 +25,8 @@ using namespace std; static ConfigReader *helpop; static Server *Srv; -bool do_helpop(char**, int, userrec*); -void sendtohelpop(userrec*, int, char**); +bool do_helpop(const char**, int, userrec*); +void sendtohelpop(userrec*, int, const char**); /* $ModDesc: /helpop Command, Works like Unreal helpop */ @@ -66,7 +66,7 @@ class cmd_helpop : public command_t this->source = "m_helpop.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { char a[MAXBUF]; std::string output = " "; @@ -80,12 +80,12 @@ class cmd_helpop : public command_t return; } - if (parameters[0][0] == '!') + if (*parameters[0] == '!') { // Force send to all +h users sendtohelpop(user, pcnt, parameters); } - else if (parameters[0][0] == '?') + else if (*parameters[0] == '?') { // Force to the helpop system with no forward if not found. if (do_helpop(parameters, pcnt, user) == false) @@ -127,25 +127,22 @@ class cmd_helpop : public command_t }; -bool do_helpop(char **parameters, int pcnt, userrec *src) +bool do_helpop(const char** parameters, int pcnt, userrec *src) { - char *search; + char search[MAXBUF]; std::string output = " "; // a fix bought to you by brain :p char a[MAXBUF]; int nlines = 0; if (!pcnt) { - search = "start"; + strcpy(search,"start"); } else { - search = parameters[0]; - } - - if (search[0] == '?') - { - search++; + if (*parameters[0] == '?') + parameters[0]++; + strlcpy(search,parameters[0],MAXBUF); } strlower(search); @@ -165,9 +162,9 @@ bool do_helpop(char **parameters, int pcnt, userrec *src) -void sendtohelpop(userrec *src, int pcnt, char **params) +void sendtohelpop(userrec *src, int pcnt, const char **params) { - char* first = params[0]; + const char* first = params[0]; if (*first == '!') { first++; diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 8b2b74dba..b4e535d9b 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -35,7 +35,7 @@ class cmd_knock : public command_t this->source = "m_knock.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { chanrec* c = Srv->FindChannel(parameters[0]); diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 8f310f4b2..52fed00f0 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -195,12 +195,12 @@ class ModuleMsgFlood : public Module f->clear(user); if (f->ban) { - char* parameters[3]; + const char* parameters[3]; parameters[0] = dest->name; parameters[1] = "+b"; parameters[2] = user->MakeWildHost(); Srv->SendMode(parameters,3,user); - std::deque<std::string> n; + std::deque<std::string> n; /* Propogate the ban to other servers. * We dont know what protocol we may be using, * so this event is picked up by our protocol diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 47c15e792..df8a551dd 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -37,7 +37,7 @@ class cmd_nicklock : public command_t this->source = "m_nicklock.so"; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { userrec* source = Srv->FindNick(std::string(parameters[0])); irc::string server; @@ -72,7 +72,7 @@ class cmd_nickunlock : public command_t this->source = "m_nickunlock.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* source = Srv->FindNick(std::string(parameters[0])); if (source) diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 559b01285..8188c49b1 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -49,7 +49,7 @@ class ModuleOperLog : public Module List[I_OnPreCommand] = List[I_On005Numeric] = 1; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp index 8a5e4b3c7..4116ccb37 100644 --- a/src/modules/m_opermd5.cpp +++ b/src/modules/m_opermd5.cpp @@ -276,7 +276,7 @@ class cmd_mkpasswd : public command_t this->source = "m_opermd5.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { char buffer[MAXBUF]; GenHash(parameters[0],buffer); diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 4cf360e2a..1181a32c3 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -76,9 +76,9 @@ class ModuleModesOnOper : public Module ThisOpersModes = "+" + ThisOpersModes; if (ThisOpersModes != "") { - char* modes[2]; + const char* modes[2]; modes[0] = user->nick; - modes[1] = (char*)ThisOpersModes.c_str(); + modes[1] = ThisOpersModes.c_str(); Srv->SendMode(modes,2,user); } break; diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index 5f9dafa65..b4a85e889 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -51,7 +51,7 @@ class cmd_opermotd : public command_t this->source = "m_opermotd.so"; } - void Handle (char** parameters, int pcnt, userrec* user) + void Handle (const char** parameters, int pcnt, userrec* user) { ShowOperMOTD(user); } diff --git a/src/modules/m_opersha256.cpp b/src/modules/m_opersha256.cpp index 0a18c32af..ecade64ad 100644 --- a/src/modules/m_opersha256.cpp +++ b/src/modules/m_opersha256.cpp @@ -232,7 +232,7 @@ public: this->source = "m_opersha256.so"; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { char buffer[SHA256_BLOCK_SIZE + 1]; SHA256(parameters[0], buffer, strlen(parameters[0])); diff --git a/src/modules/m_operwho.cpp b/src/modules/m_operwho.cpp index 9370ad765..edb0aea4d 100644 --- a/src/modules/m_operwho.cpp +++ b/src/modules/m_operwho.cpp @@ -41,7 +41,7 @@ class ModuleOperWho : public Module List[I_OnPreCommand] = 1; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { if ((!*user->oper) || (command != "WHO")) diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index c57102287..782cf2f3b 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -63,7 +63,7 @@ class cmd_park : public command_t this->source = "m_park.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { /** Parking. easy stuff. * @@ -108,7 +108,7 @@ class cmd_parkstats : public command_t this->source = "m_park.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { char status[MAXBUF]; snprintf(status,MAXBUF,"NOTICE %s :There are a total of %lu parked clients on this server, with a maximum of %lu parked sessions allowed per user.",user->nick,(unsigned long)pinfo.size(),(unsigned long)ConcurrentParks); @@ -124,7 +124,7 @@ class cmd_unpark : public command_t this->source = "m_park.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { /** Unparking. complicated stuff. * diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 64c967ae8..12049b376 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -41,7 +41,7 @@ class cmd_randquote : public command_t this->source = "m_randquote.so"; } - void Handle (char** parameters, int pcntl, userrec *user) + void Handle (const char** parameters, int pcntl, userrec *user) { std::string str; int fsize; diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index d865066b3..59c1fcda2 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -55,7 +55,7 @@ class cmd_remove : public command_t this->source = "m_remove.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* target; chanrec* channel; diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index a95198a5e..148040c6c 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -166,7 +166,7 @@ class ModuleSafeList : public Module * OnPreCommand() * Intercept the LIST command. */ - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) @@ -183,7 +183,7 @@ class ModuleSafeList : public Module * HandleList() * Handle (override) the LIST command. */ - int HandleList(char** parameters, int pcnt, userrec* user) + int HandleList(const char** parameters, int pcnt, userrec* user) { /* First, let's check if the user is currently /list'ing */ ListData *ld; diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 2c9273e70..39a95a27c 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -35,7 +35,7 @@ class cmd_sajoin : public command_t this->source = "m_sajoin.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 280a5ae19..905eed0c8 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -46,7 +46,7 @@ class cmd_samode : public command_t this->source = "m_samode.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { /* * Handles an SAMODE request. Notifies all +s users. diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 5d449d7e0..6c07d08ce 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -34,7 +34,7 @@ class cmd_sanick : public command_t this->source = "m_sanick.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* source = Srv->FindNick(std::string(parameters[0])); if (source) diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 9203b7d36..afbdbdc87 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -35,7 +35,7 @@ class cmd_sapart : public command_t this->source = "m_sapart.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 8174d5a64..d43b97102 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -44,7 +44,7 @@ class cmd_saquit : public command_t this->source = "m_saquit.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index fab32c2b4..97f84f5c7 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -55,7 +55,7 @@ class ModuleSecureList : public Module * OnPreCommand() * Intercept the LIST command. */ - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index a0223f971..f27e74a4d 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -210,7 +210,7 @@ class ModuleServices : public Module /* On nickchange, if they have +r, remove it */ if (user->IsModeSet('r')) { - char* modechange[2]; + const char* modechange[2]; modechange[0] = user->nick; modechange[1] = "-r"; kludgeme = true; diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 7244ba6de..eb2196c92 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -35,7 +35,7 @@ class cmd_sethost : public command_t this->source = "m_sethost.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (strlen(parameters[0]) > 64) { diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index 4ec8e0fdb..12221edb0 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -14,7 +14,7 @@ class cmd_setident : public command_t this->source = "m_setident.so"; } - void Handle(char **parameters, int pcnt, userrec *user) + void Handle(const char** parameters, int pcnt, userrec *user) { for(unsigned int x = 0; x < strlen(parameters[0]); x++) { diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index af0bc2c64..040625238 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -35,7 +35,7 @@ class cmd_setidle : public command_t this->source = "m_setidle.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (atoi(parameters[0]) < 1) { diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index b82f6de14..9a3b2a942 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -35,7 +35,7 @@ class cmd_setname : public command_t this->source = "m_setname.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { std::string line = ""; for (int i = 0; i < pcnt-1; i++) diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 9cf2912f7..39b810dfe 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -41,7 +41,7 @@ class cmd_silence : public command_t this->source = "m_silence.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (!pcnt) { @@ -62,7 +62,7 @@ class cmd_silence : public command_t else if (pcnt > 0) { // one or more parameters, add or delete entry from the list (only the first parameter is used) - char *nick = parameters[0]; + const char *nick = parameters[0]; if (nick[0] == '-') { // removing an item from the list diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 5222d8f18..22c9e9246 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -555,9 +555,9 @@ class cmd_rconnect : public command_t cmd_rconnect (Module* Callback) : command_t("RCONNECT", 'o', 2), Creator(Callback) { this->source = "m_spanningtree.so"; - } + } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { WriteServ(user->fd,"NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]); /* Is this aimed at our server? */ @@ -565,7 +565,7 @@ class cmd_rconnect : public command_t { /* Yes, initiate the given connect */ WriteOpers("*** Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0],parameters[1]); - char* para[1]; + const char* para[1]; para[0] = parameters[1]; Creator->OnPreCommand("CONNECT", para, 1, user, true); } @@ -888,7 +888,7 @@ class TreeSocket : public InspSocket return true; userrec* who = new userrec(); who->fd = FD_MAGIC_NUMBER; - char* modelist[64]; + const char* modelist[64]; memset(&modelist,0,sizeof(modelist)); for (unsigned int q = 0; q < params.size(); q++) { @@ -956,7 +956,7 @@ class TreeSocket : public InspSocket memset(&mode_users,0,sizeof(mode_users)); mode_users[0] = first; mode_users[1] = modestring; - strcpy(mode_users[1],"+"); + strcpy(first,"+"); unsigned int modectr = 2; userrec* who = NULL; @@ -991,7 +991,7 @@ class TreeSocket : public InspSocket for (unsigned int usernum = 2; usernum < params.size(); usernum++) { /* process one channel at a time, applying modes. */ - char* usr = const_cast<char*>(params[usernum].c_str()); + char* usr = (char*)params[usernum].c_str(); /* Safety check just to make sure someones not sent us an FJOIN full of spaces * (is this even possible?) */ if (usr && *usr) @@ -1028,7 +1028,7 @@ class TreeSocket : public InspSocket { /* We also always let u-lined clients win, no matter what the TS value */ log(DEBUG,"Our our channel newer than theirs, accepting their modes"); - Srv->SendMode(mode_users,modectr,who); + Srv->SendMode((const char**)mode_users,modectr,who); } else { @@ -1058,7 +1058,7 @@ class TreeSocket : public InspSocket if (ourTS >= TS) { log(DEBUG,"Our our channel newer than theirs, accepting their modes"); - Srv->SendMode(mode_users,modectr,who); + Srv->SendMode((const char**)mode_users,modectr,who); } else { @@ -2555,10 +2555,10 @@ class TreeSocket : public InspSocket } // its a user target = who->server; - char* strparams[127]; + const char* strparams[127]; for (unsigned int q = 0; q < params.size(); q++) { - strparams[q] = (char*)params[q].c_str(); + strparams[q] = params[q].c_str(); } if (!Srv->CallCommandHandler(command.c_str(), strparams, params.size(), who)) { @@ -2970,14 +2970,14 @@ class ModuleSpanningTree : public Module return serverlist.size(); } - void HandleLinks(char** parameters, int pcnt, userrec* user) + void HandleLinks(const char** parameters, int pcnt, userrec* user) { ShowLinks(TreeRoot,user,0); WriteServ(user->fd,"365 %s * :End of /LINKS list.",user->nick); return; } - void HandleLusers(char** parameters, int pcnt, userrec* user) + void HandleLusers(const char** parameters, int pcnt, userrec* user) { unsigned int n_users = usercnt(); @@ -3062,7 +3062,7 @@ class ModuleSpanningTree : public Module // (a character matrix), then draw the branches as a series of "L" shapes // from the nodes. This is not only friendlier on CPU it uses less stack. - void HandleMap(char** parameters, int pcnt, userrec* user) + void HandleMap(const char** parameters, int pcnt, userrec* user) { // This array represents a virtual screen which we will // "scratch" draw to, as the console device of an irc @@ -3118,7 +3118,7 @@ class ModuleSpanningTree : public Module return; } - int HandleSquit(char** parameters, int pcnt, userrec* user) + int HandleSquit(const char** parameters, int pcnt, userrec* user) { TreeServer* s = FindServerMask(parameters[0]); if (s) @@ -3148,7 +3148,7 @@ class ModuleSpanningTree : public Module return 1; } - int HandleTime(char** parameters, int pcnt, userrec* user) + int HandleTime(const char** parameters, int pcnt, userrec* user) { if ((user->fd > -1) && (pcnt)) { @@ -3172,7 +3172,7 @@ class ModuleSpanningTree : public Module return 1; } - int HandleRemoteWhois(char** parameters, int pcnt, userrec* user) + int HandleRemoteWhois(const char** parameters, int pcnt, userrec* user) { if ((user->fd > -1) && (pcnt > 1)) { @@ -3250,7 +3250,7 @@ class ModuleSpanningTree : public Module } } - int HandleVersion(char** parameters, int pcnt, userrec* user) + int HandleVersion(const char** parameters, int pcnt, userrec* user) { // we've already checked if pcnt > 0, so this is safe TreeServer* found = FindServerMask(parameters[0]); @@ -3287,7 +3287,7 @@ class ModuleSpanningTree : public Module return 1; } - int HandleConnect(char** parameters, int pcnt, userrec* user) + int HandleConnect(const char** parameters, int pcnt, userrec* user) { for (std::vector<Link>::iterator x = LinkBlocks.begin(); x < LinkBlocks.end(); x++) { @@ -3336,7 +3336,7 @@ class ModuleSpanningTree : public Module return 0; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp index 625b5c971..e69db8ed5 100644 --- a/src/modules/m_spy.cpp +++ b/src/modules/m_spy.cpp @@ -92,7 +92,7 @@ class cmd_spylist : public command_t this->source = "m_spy.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { WriteOpers("*** Oper %s used SPYLIST to list +s/+p channels and keys.",user->nick); WriteServ(user->fd,"321 %s Channel :Users Name",user->nick); @@ -112,7 +112,7 @@ class cmd_spynames : public command_t this->source = "m_spy.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { chanrec* c; diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 2b7e58413..41248832d 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -31,7 +31,7 @@ class cmd_swhois : public command_t this->source = "m_swhois.so"; } - void Handle(char** parameters, int pcnt, userrec* user) + void Handle(const char** parameters, int pcnt, userrec* user) { userrec* dest = Srv->FindNick(std::string(parameters[0])); if(dest) diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 881024cc7..1f8aaac1a 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -51,7 +51,7 @@ class cmd_woot : public command_t this->source = "m_testcommand.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { /* We dont have to worry about deleting 'r', the core will * do it for us as required.*/ diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index da0c0faeb..2f4f040c0 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -47,7 +47,7 @@ class cmd_tban : public command_t this->source = "m_timedbans.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { chanrec* channel = Srv->FindChannel(parameters[0]); if (channel) @@ -83,7 +83,7 @@ class cmd_tban : public command_t char duration[MAXBUF]; snprintf(duration,MAXBUF,"%lu",Srv->CalcDuration(parameters[1])); std::string mask = parameters[2]; - char *setban[32]; + const char *setban[32]; setban[0] = parameters[0]; setban[1] = "+b"; setban[2] = parameters[2]; @@ -157,10 +157,10 @@ class ModuleTimedBans : public Module if (cr) { Srv->SendChannelServerNotice(Srv->GetServerName(),cr,"NOTICE "+std::string(cr->name)+" :Timed ban on "+i->mask+" expired."); - char *setban[3]; - setban[0] = (char*)i->channel.c_str(); + const char *setban[3]; + setban[0] = i->channel.c_str(); setban[1] = "-b"; - setban[2] = (char*)i->mask.c_str(); + setban[2] = i->mask.c_str(); // kludge alert! // ::SendMode expects a userrec* to send the numeric replies // back to, so we create it a fake user that isnt in the user diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index 14660cf1e..c8332319f 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -35,7 +35,7 @@ class cmd_uninvite : public command_t this->source = "m_uninvite.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { userrec* u = Find(parameters[0]); chanrec* c = FindChan(parameters[1]); diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 55101705e..0b62df0a1 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -35,7 +35,7 @@ class cmd_userip : public command_t this->source = "m_userip.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { char Return[MAXBUF],junk[MAXBUF]; snprintf(Return,MAXBUF,"340 %s :",user->nick); diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index 270d7aa0b..61d07a7e2 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -35,7 +35,7 @@ class cmd_vhost : public command_t this->source = "m_vhost.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { for (int index = 0; index < Conf->Enumerate("vhost"); index++) { diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index faf0792dc..c15609a4d 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -47,7 +47,7 @@ class cmd_watch : public command_t this->source = "m_watch.so"; } - void Handle (char **parameters, int pcnt, userrec *user) + void Handle (const char** parameters, int pcnt, userrec *user) { if (!pcnt) { @@ -68,7 +68,7 @@ class cmd_watch : public command_t { for (int x = 0; x < pcnt; x++) { - char *nick = parameters[x]; + const char *nick = parameters[x]; if (!strcasecmp(nick,"C")) { // watch clear diff --git a/src/users.cpp b/src/users.cpp index f455bb825..1e2e35321 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -944,7 +944,7 @@ void FullConnectUser(userrec* user, CullList* Goners) * re-allocates a nick in the user_hash after they change nicknames, * returns a pointer to the new user as it may have moved */ -userrec* ReHashNick(char* Old, char* New) +userrec* ReHashNick(const char* Old, const char* New) { //user_hash::iterator newnick; user_hash::iterator oldnick = clientlist.find(Old); @@ -1003,10 +1003,10 @@ void force_nickchange(userrec* user,const char* newnick) if (user->registered == 7) { - char* pars[1]; - + const char* pars[1]; pars[0] = nick; std::string cmd = "NICK"; + ServerInstance->Parser->CallHandler(cmd,pars,1,user); } } |