diff options
-rw-r--r-- | src/modules/m_blockcaps.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_chghost.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_sethost.cpp | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index eba86f94b..0b5736f64 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -86,9 +86,10 @@ public: size_t upper = 0; for (std::string::const_iterator iter = text_begin; iter != text_end; ++iter) { - if (uppercase.test(*iter)) + unsigned char chr = static_cast<unsigned char>(*iter); + if (uppercase.test(chr)) upper += 1; - else if (!lowercase.test(*iter)) + else if (!lowercase.test(chr)) length -= 1; } @@ -114,12 +115,12 @@ public: lowercase.reset(); const std::string lower = tag->getString("lowercase", "abcdefghijklmnopqrstuvwxyz"); for (std::string::const_iterator iter = lower.begin(); iter != lower.end(); ++iter) - lowercase.set(*iter); + lowercase.set(static_cast<unsigned char>(*iter)); uppercase.reset(); const std::string upper = tag->getString("uppercase", tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")); for (std::string::const_iterator iter = upper.begin(); iter != upper.end(); ++iter) - uppercase.set(*iter); + uppercase.set(static_cast<unsigned char>(*iter)); } Version GetVersion() CXX11_OVERRIDE diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index cda13c976..10e447b45 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -47,7 +47,7 @@ class CommandChghost : public Command for (std::string::const_iterator x = parameters[1].begin(); x != parameters[1].end(); x++) { - if (!hostmap.test(*x)) + if (!hostmap.test(static_cast<unsigned char>(*x))) { user->WriteNotice("*** CHGHOST: Invalid characters in hostname"); return CMD_FAILURE; @@ -98,7 +98,7 @@ class ModuleChgHost : public Module cmd.hostmap.reset(); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) - cmd.hostmap.set(*n); + cmd.hostmap.set(static_cast<unsigned char>(*n)); } Version GetVersion() CXX11_OVERRIDE diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index b75bac425..678d9d979 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -45,7 +45,7 @@ class CommandSethost : public Command for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++) { - if (!hostmap.test(*x)) + if (!hostmap.test(static_cast<unsigned char>(*x))) { user->WriteNotice("*** SETHOST: Invalid characters in hostname"); return CMD_FAILURE; @@ -79,7 +79,7 @@ class ModuleSetHost : public Module cmd.hostmap.reset(); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) - cmd.hostmap.set(*n); + cmd.hostmap.set(static_cast<unsigned char>(*n)); } Version GetVersion() CXX11_OVERRIDE |