[draco] Make sure ctype calls use unsigned char.

Addresses https://github.com/assimp/assimp/issues/3867 and then some.
pull/3880/head
Jason C 2021-05-04 17:22:44 -04:00
parent 2925592c64
commit 1ec8d4b6cf
2 changed files with 3 additions and 3 deletions

View File

@ -252,7 +252,7 @@ DecoderBuffer ParseLineIntoDecoderBuffer(DecoderBuffer *buffer) {
std::string ToLower(const std::string &str) { std::string ToLower(const std::string &str) {
std::string out; std::string out;
std::transform(str.begin(), str.end(), std::back_inserter(out), tolower); std::transform(str.begin(), str.end(), std::back_inserter(out), [](unsigned char c){return tolower(c);});
return out; return out;
} }

View File

@ -268,14 +268,14 @@ std::vector<std::string> PlyReader::SplitWords(const std::string &line) {
while ((end = line.find_first_of(" \t\n\v\f\r", start)) != while ((end = line.find_first_of(" \t\n\v\f\r", start)) !=
std::string::npos) { std::string::npos) {
const std::string word(line.substr(start, end - start)); const std::string word(line.substr(start, end - start));
if (!std::all_of(word.begin(), word.end(), isspace)) { if (!std::all_of(word.begin(), word.end(), [](unsigned char c){return isspace(c);})) {
output.push_back(word); output.push_back(word);
} }
start = end + 1; start = end + 1;
} }
const std::string last_word(line.substr(start)); const std::string last_word(line.substr(start));
if (!std::all_of(last_word.begin(), last_word.end(), isspace)) { if (!std::all_of(last_word.begin(), last_word.end(), [](unsigned char c){return isspace(c);})) {
output.push_back(last_word); output.push_back(last_word);
} }
return output; return output;