std::tolower is undefined if the argument's value is neither representable as unsigned char nor equal to EOF (#761)

Co-authored-by: taoxu <taoxu@bilibili.com>
This commit is contained in:
372046933 2020-11-19 22:21:40 +08:00 committed by GitHub
parent e273fec93c
commit e1133a2dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ struct ci {
bool operator()(const std::string &s1, const std::string &s2) const { bool operator()(const std::string &s1, const std::string &s2) const {
return std::lexicographical_compare( return std::lexicographical_compare(
s1.begin(), s1.end(), s2.begin(), s2.end(), s1.begin(), s1.end(), s2.begin(), s2.end(),
[](char c1, char c2) { return ::tolower(c1) < ::tolower(c2); }); [](unsigned char c1, unsigned char c2) { return ::tolower(c1) < ::tolower(c2); });
} }
}; };