summaryrefslogtreecommitdiff
path: root/src/modulemanager.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-02-02 17:07:34 +0000
committerSadie Powell <sadie@witchery.services>2020-02-02 20:32:49 +0000
commitaed712ba8e087232fcd9f71db4311687a7ce4398 (patch)
treefe06900c63293fabab60faf863bf97a390a0df20 /src/modulemanager.cpp
parentfda43fc0ff5ecf87d877cc341961c9da4affae76 (diff)
Make loading modules considerably more robust and user friendly.
Diffstat (limited to 'src/modulemanager.cpp')
-rw-r--r--src/modulemanager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index 218b9aa5a..e5309af57 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -69,13 +69,13 @@ bool ModuleManager::Load(const std::string& modname, bool defer)
newmod->ModuleSourceFile = filename;
newmod->ModuleDLLManager = newhandle;
Modules[filename] = newmod;
- std::string version = newhandle->GetVersion();
- if (version.empty())
- version.assign("unknown");
+ const char* version = newhandle->GetVersion();
+ if (!version)
+ version = "unknown";
if (defer)
{
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)",
- filename.c_str(), version.c_str());
+ filename.c_str(), version);
}
else
{
@@ -88,7 +88,7 @@ bool ModuleManager::Load(const std::string& modname, bool defer)
Version v = newmod->GetVersion();
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)%s",
- filename.c_str(), version.c_str(), (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
+ filename.c_str(), version, (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
}
}
else