X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigparser.cpp;h=8a3042ebadba5393f4281eeb244fc2fd11181f76;hb=ba31d8080f75a0147d0b380f2c51251e024f0deb;hp=5ee86c81178c49acd128ac940ae02aedc05757dc;hpb=780dda83ba3857bc3c330d4b5d38bb251a9d879b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configparser.cpp b/src/configparser.cpp index 5ee86c811..8a3042eba 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -524,12 +524,15 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def, return ret; } -double ConfigTag::getFloat(const std::string &key, double def) +double ConfigTag::getFloat(const std::string& key, double def, double min, double max) { std::string result; if (!readString(key, result)) return def; - return strtod(result.c_str(), NULL); + + double res = strtod(result.c_str(), NULL); + CheckRange(tag, key, res, def, min, max); + return res; } bool ConfigTag::getBool(const std::string &key, bool def)