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
This commit is contained in:
Ben Clayton 2020-02-07 23:48:01 +00:00 committed by GitHub
parent e5ea03ce07
commit 8982e1ee6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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