Fix warnings in configreader.cpp on FreeBSD

Fixes #348 reported by @netkurd
This commit is contained in:
attilamolnar 2012-10-28 14:54:39 +01:00
parent df2ee078aa
commit 1357ed09cc

View File

@ -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;
}