diff options
| author | 2022-03-11 12:14:00 +0000 | |
|---|---|---|
| committer | 2022-03-11 12:17:57 +0000 | |
| commit | 8342d531ff860849bb1ebb6d2d9c2853b10a9b7d (patch) | |
| tree | 716f525b1ba151ab8d5e307b5b72b73e3e66353b /src/modules/m_channames.cpp | |
| parent | Only set the chanlog channel name handler after reading the config. (diff) | |
Use UCHAR_MAX instead of raw sizes in channames.
This matches other code that does similar things.
Diffstat (limited to 'src/modules/m_channames.cpp')
| -rw-r--r-- | src/modules/m_channames.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index 5af8a433b..99e837768 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -24,7 +24,7 @@ #include "inspircd.h" -static std::bitset<256> allowedmap; +static std::bitset<UCHAR_MAX + 1> allowedmap; class NewIsChannelHandler { @@ -39,7 +39,7 @@ bool NewIsChannelHandler::Call(const std::string& channame) for (std::string::const_iterator c = channame.begin(); c != channame.end(); ++c) { - unsigned int i = *c & 0xFF; + unsigned char i = static_cast<unsigned char>(*c); if (!allowedmap[i]) return false; } @@ -114,12 +114,12 @@ class ModuleChannelNames : public Module irc::portparser denyrange(denyToken, false); int denyno = -1; while (0 != (denyno = denyrange.GetToken())) - allowedmap[denyno & 0xFF] = false; + allowedmap[denyno & UCHAR_MAX] = false; irc::portparser allowrange(allowToken, false); int allowno = -1; while (0 != (allowno = allowrange.GetToken())) - allowedmap[allowno & 0xFF] = true; + allowedmap[allowno & UCHAR_MAX] = true; allowedmap[0x07] = false; // BEL allowedmap[0x20] = false; // ' ' |
