diff options
| author | 2021-03-14 04:55:01 +0000 | |
|---|---|---|
| committer | 2021-03-17 04:16:24 +0000 | |
| commit | 8cb6691601602e560fbf3cb2122dd4e12bb4bcf1 (patch) | |
| tree | aca1965bdc281e9bbaf4490ccff63ceab09ee166 /src/configparser.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Default <permchannelsdb:listmodes> to on. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 2254cefda..84b300121 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -584,7 +584,7 @@ namespace long ConfigTag::getInt(const std::string& key, long def, long min, long max) const { std::string result; - if(!readString(key, result)) + if(!readString(key, result) || result.empty()) return def; const char* res_cstr = result.c_str(); @@ -601,7 +601,7 @@ long ConfigTag::getInt(const std::string& key, long def, long min, long max) con unsigned long ConfigTag::getUInt(const std::string& key, unsigned long def, unsigned long min, unsigned long max) const { std::string result; - if (!readString(key, result)) + if (!readString(key, result) || result.empty()) return def; const char* res_cstr = result.c_str(); @@ -618,7 +618,7 @@ unsigned long ConfigTag::getUInt(const std::string& key, unsigned long def, unsi unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def, unsigned long min, unsigned long max) const { std::string duration; - if (!readString(key, duration)) + if (!readString(key, duration) || duration.empty()) return def; unsigned long ret; @@ -647,7 +647,7 @@ double ConfigTag::getFloat(const std::string& key, double def, double min, doubl bool ConfigTag::getBool(const std::string& key, bool def) const { std::string result; - if(!readString(key, result)) + if(!readString(key, result) || result.empty()) return def; if (stdalgo::string::equalsci(result, "yes") || stdalgo::string::equalsci(result, "true") || stdalgo::string::equalsci(result, "on")) |
