diff options
| author | 2021-06-10 01:45:43 +0100 | |
|---|---|---|
| committer | 2021-06-10 01:45:43 +0100 | |
| commit | 9482331f147b9d27547e3aaa085dbc3222a342df (patch) | |
| tree | 3dd23874a415a60d12d28398edd9644b196721ca /src/modulemanager.cpp | |
| parent | Avoid creating unnecessary symlinks. (diff) | |
Fix undefined behaviour with converting a path to a string.
Diffstat (limited to 'src/modulemanager.cpp')
| -rw-r--r-- | src/modulemanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 30105cc3a..a600ed8ad 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -131,8 +131,11 @@ void ModuleManager::LoadCoreModules(std::map<std::string, ServiceList>& servicem { for (const auto& entry : std::filesystem::directory_iterator(ServerInstance->Config->Paths.Module)) { - const std::string name = ConvToStr(entry.path().filename()); - if (!entry.is_regular_file() || !InspIRCd::Match(name, "core_*" DLL_EXTENSION)) + if (!entry.is_regular_file()) + continue; + + const std::string name = entry.path().filename().string(); + if (!InspIRCd::Match(name, "core_*" DLL_EXTENSION)) continue; std::cout << "." << std::flush; |
