diff options
Diffstat (limited to 'src/libutil/config.cc')
-rw-r--r-- | src/libutil/config.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 7af3e7883..7467e5ac0 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -230,7 +230,9 @@ template<typename T> void BaseSetting<T>::set(const std::string & str, bool append) { static_assert(std::is_integral<T>::value, "Integer required."); - if (!string2Int(str, value)) + if (auto n = string2Int<T>(str)) + value = *n; + else throw UsageError("setting '%s' has invalid value '%s'", name, str); } |