From 72da54c1c2a4f4b59d852e79adaee3348c4874ad Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 23 Dec 2006 23:18:34 +0000 Subject: Crash on /rehash fixed (old code in here passed NULL, 0 as argc, argv, this is BAD BAD BAD.) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6081 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_rehash.cpp | 2 +- src/helperfuncs.cpp | 2 -- src/inspircd.cpp | 4 ++++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp index 518b7fbf4..7b9db22e0 100644 --- a/src/cmd_rehash.cpp +++ b/src/cmd_rehash.cpp @@ -36,7 +36,7 @@ CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user) { ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE)); ServerInstance->CloseLog(); - ServerInstance->OpenLog(NULL,0); + ServerInstance->OpenLog(ServerInstance->Config->argv, ServerInstance->Config->argc); ServerInstance->RehashUsersAndChans(); ServerInstance->Config->Read(false,user); } diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 506b6e2d6..fdbeb613f 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -429,8 +429,6 @@ bool InspIRCd::IsNick(const char* n) void InspIRCd::OpenLog(char** argv, int argc) { Config->MyDir = ServerConfig::GetFullProgDir(argv,argc); - Config->argv = argv; - Config->argc = argc; if (!*this->LogFileName) { diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 5cfb55ab1..c8be0d019 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -266,6 +266,10 @@ InspIRCd::InspIRCd(int argc, char** argv) this->chanlist = new chan_hash(); this->Config = new ServerConfig(this); + + this->Config->argv = argv; + this->Config->argc = argc; + this->Config->opertypes.clear(); this->Config->operclass.clear(); this->SNO = new SnomaskManager(this); -- cgit v1.2.3