diff options
| author | 2013-05-06 11:49:50 +0100 | |
|---|---|---|
| committer | 2013-05-15 03:32:56 +0100 | |
| commit | accccc212cd4f08a3c5532b1ae7a17e76bac8718 (patch) | |
| tree | 18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/modmanager_dynamic.cpp | |
| parent | Merge pull request #523 from SaberUK/master+server-notice (diff) | |
| download | inspircd++-accccc212cd4f08a3c5532b1ae7a17e76bac8718.tar.gz inspircd++-accccc212cd4f08a3c5532b1ae7a17e76bac8718.tar.bz2 inspircd++-accccc212cd4f08a3c5532b1ae7a17e76bac8718.zip | |
Replace some C-isms with C++-isms.
* 'const char*' to 'const std::string&'.
* snprintf to std::string concatenation.
* Replace duplicated OneOfMatches with InspIRCd::MatchMask.
Diffstat (limited to 'src/modmanager_dynamic.cpp')
| -rw-r--r-- | src/modmanager_dynamic.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index a153accbb..b58697679 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -37,10 +37,9 @@ bool ModuleManager::Load(const std::string& filename, bool defer) if (filename.find('/') != std::string::npos) return false; - char modfile[MAXBUF]; - snprintf(modfile,MAXBUF,"%s/%s",ServerInstance->Config->ModPath.c_str(),filename.c_str()); + const std::string moduleFile = ServerInstance->Config->ModPath + "/" + filename; - if (!ServerConfig::FileExists(modfile)) + if (!ServerConfig::FileExists(moduleFile.c_str())) { LastModuleError = "Module file could not be found: " + filename; ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError); @@ -55,7 +54,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer) } Module* newmod = NULL; - DLLManager* newhandle = new DLLManager(modfile); + DLLManager* newhandle = new DLLManager(moduleFile.c_str()); try { |
