diff options
author | Sadie Powell <sadie@witchery.services> | 2020-04-09 15:18:04 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-04-09 15:18:04 +0100 |
commit | bb39d78be61e45555cdd87985e26ea07b725fabf (patch) | |
tree | 157dc8144dca9d65eec162773fe3f845e6a5582f /src/modules/m_sethost.cpp | |
parent | 52a433cfccad8559ff7d12f7ea308d8f4570444f (diff) |
Set the minimum length to 1 for most config items with a default.
Diffstat (limited to 'src/modules/m_sethost.cpp')
-rw-r--r-- | src/modules/m_sethost.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 2bacded6f..022434ec9 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -80,10 +80,11 @@ class ModuleSetHost : public Module void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { - std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"); + ConfigTag* tag = ServerInstance->Config->ConfValue("hostname"); + const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); cmd.hostmap.reset(); - for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) + for (std::string::const_iterator n = hmap.begin(); n != hmap.end(); n++) cmd.hostmap.set(static_cast<unsigned char>(*n)); } |