diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-10-28 14:54:39 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-10-28 14:58:32 +0100 |
commit | 1357ed09ccdab5c2b19bb108ef3723a1e308e337 (patch) | |
tree | 13ada5c9334b31ba324fc475a44bf48ab2f55039 /src | |
parent | df2ee078aa3c3830ae7365a920faa502d97c66d1 (diff) |
Fix warnings in configreader.cpp on FreeBSD
Fixes #348 reported by @netkurd
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 82f4d7c43..68beddb27 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -610,7 +610,9 @@ void ServerConfig::Fill() std::string modes = ConfValue("disabled")->getString("usermodes"); for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { - if (*p < 'A' || *p > ('A' + 64)) throw CoreException("Invalid usermode " + std::string(1, *p) + " was found."); + // Complain when the character is not a-z or A-Z + if ((*p < 'A') || (*p > 'z') || ((*p < 'a') && (*p > 'Z'))) + throw CoreException("Invalid usermode " + std::string(1, *p) + " was found."); DisabledUModes[*p - 'A'] = 1; } @@ -618,7 +620,8 @@ void ServerConfig::Fill() modes = ConfValue("disabled")->getString("chanmodes"); for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { - if (*p < 'A' || *p > ('A' + 64)) throw CoreException("Invalid chanmode " + std::string(1, *p) + " was found."); + if ((*p < 'A') || (*p > 'z') || ((*p < 'a') && (*p > 'Z'))) + throw CoreException("Invalid chanmode " + std::string(1, *p) + " was found."); DisabledCModes[*p - 'A'] = 1; } |