1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Warn about really big integer values in the config

This commit is contained in:
Adam
2012-07-18 16:52:14 -04:00
parent 28aa981464
commit 48022c3ddf
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ class CommandOSSet : public Command
Log(LOG_ADMIN, source, this) << "DEBUG ON";
source.Reply(_("Services are now in debug mode."));
}
else if (setting.equals_ci("OFF") || (setting[0] == '0' && setting.is_number_only() && !convertTo<int>(setting)))
else if (setting.equals_ci("OFF") || setting == "0")
{
Log(LOG_ADMIN, source, this) << "DEBUG OFF";
debug = 0;
+10 -1
View File
@@ -1941,7 +1941,16 @@ int ValueItem::GetInteger() const
{
if (v.empty() || !v.is_number_only())
return 0;
return convertTo<int>(v);
try
{
return convertTo<int>(v);
}
catch (const ConvertException &)
{
Log() << "Unable to convert configuration value " << this->v << " to an integer. Value too large?";
}
return 0;
}
const char *ValueItem::GetString() const