diff options
author | Adam <Adam@anope.org> | 2012-07-18 16:52:14 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-07-18 16:52:14 -0400 |
commit | 48022c3ddfaa162f546c8fd7235586a2c7f36fc8 (patch) | |
tree | e838e7fb52301336031bea85400353b7787178a9 /src/config.cpp | |
parent | 28aa981464dc5834a04f52314c798adab260c5a4 (diff) |
Warn about really big integer values in the config
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/config.cpp b/src/config.cpp index 0c5d1c2af..2c0e264f2 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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 |