diff options
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/ModuleManager.cpp | 6 | ||||
-rw-r--r-- | src/Common/UserManager.cpp | 34 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/Common/ModuleManager.cpp b/src/Common/ModuleManager.cpp index 78a6459..053d395 100644 --- a/src/Common/ModuleManager.cpp +++ b/src/Common/ModuleManager.cpp @@ -62,9 +62,9 @@ bool ModuleManager::handleConfigEntry(const Core::ConfigEntry &entry, bool handl if(handled) return false; - if(entry[0].getKey().matches("LoadModule") && entry[1].empty()) { - if(!loadModule(entry[0][0].c_str())) - application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].c_str()); + if(entry[0].getKey().matches("LoadModule") && entry[1].isEmpty()) { + if(!loadModule(entry[0][0].extract())) + application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].extract().c_str()); return true; } diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp index f112894..f14dbcc 100644 --- a/src/Common/UserManager.cpp +++ b/src/Common/UserManager.cpp @@ -39,11 +39,11 @@ UserManager::~UserManager() { bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handled*/) { if(entry[0].getKey().matches("UserManager")) { if(entry[1].getKey().matches("MinUid")) { - if(entry[2].empty()) { + if(entry[2].isEmpty()) { char *endptr; - unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); - if(entry[1][0].empty() || *endptr) { - application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].c_str()); + unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10); + if(entry[1][0].isEmpty() || *endptr) { + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].extract().c_str()); } else { minUid = val; @@ -51,11 +51,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl } } else if(entry[1].getKey().matches("MaxUid")) { - if(entry[2].empty()) { + if(entry[2].isEmpty()) { char *endptr; - unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); - if(entry[1][0].empty() || *endptr) { - application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].c_str()); + unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10); + if(entry[1][0].isEmpty() || *endptr) { + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].extract().c_str()); } else { maxUid = val; @@ -63,11 +63,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl } } else if(entry[1].getKey().matches("MinGid")) { - if(entry[2].empty()) { + if(entry[2].isEmpty()) { char *endptr; - unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); - if(entry[1][0].empty() || *endptr) { - application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].c_str()); + unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10); + if(entry[1][0].isEmpty() || *endptr) { + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].extract().c_str()); } else { minGid = val; @@ -75,18 +75,18 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl } } else if(entry[1].getKey().matches("MaxGid")) { - if(entry[2].empty()) { + if(entry[2].isEmpty()) { char *endptr; - unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); - if(entry[1][0].empty() || *endptr) { - application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].c_str()); + unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10); + if(entry[1][0].isEmpty() || *endptr) { + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].extract().c_str()); } else { maxGid = val; } } } - else if(!entry[1].empty()) + else if(!entry[1].isEmpty()) return false; return true; |