From 1357ed09ccdab5c2b19bb108ef3723a1e308e337 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 28 Oct 2012 14:54:39 +0100 Subject: Fix warnings in configreader.cpp on FreeBSD Fixes #348 reported by @netkurd --- src/configreader.cpp | 7 +++++-- 1 file 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; } -- cgit v1.2.3