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) {
!(v == '0' || v == 'f' || v == 'F' || v == 'n' || v == 'N');
} else if (!value.empty()) {
std::string value_lower(value);
std::transform(value_lower.begin(), value_lower.end(),
value_lower.begin(), ::tolower);
std::transform(value_lower.begin(), value_lower.end(), value_lower.begin(),
[](char c) { return static_cast<char>(::tolower(c)); });
return !(value_lower == "false" || value_lower == "no" ||
value_lower == "off");
} 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