Unverified Commit 8982e1ee by Ben Clayton Committed by GitHub

Fix MSVC warning. (#935)

This fixes the Visual Studio 2019 warning: `C4244: '=': conversion from 'int' to 'char', possible loss of data` When implicitly casting the return value of tolower() (int) to char. Fixes: #932
parent e5ea03ce
...@@ -217,8 +217,8 @@ bool IsTruthyFlagValue(const std::string& value) { ...@@ -217,8 +217,8 @@ bool IsTruthyFlagValue(const std::string& value) {
!(v == '0' || v == 'f' || v == 'F' || v == 'n' || v == 'N'); !(v == '0' || v == 'f' || v == 'F' || v == 'n' || v == 'N');
} else if (!value.empty()) { } else if (!value.empty()) {
std::string value_lower(value); std::string value_lower(value);
std::transform(value_lower.begin(), value_lower.end(), std::transform(value_lower.begin(), value_lower.end(), value_lower.begin(),
value_lower.begin(), ::tolower); [](char c) { return static_cast<char>(::tolower(c)); });
return !(value_lower == "false" || value_lower == "no" || return !(value_lower == "false" || value_lower == "no" ||
value_lower == "off"); value_lower == "off");
} else } else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment