Fix two more warnings

This commit is contained in:
louiz’
2018-08-23 21:28:06 +02:00
parent b1564e4ddc
commit 8997021b2e
+2 -2
View File
@@ -15,11 +15,11 @@ std::vector<std::string> cut(const std::string& val, const std::size_t size)
// Get the number of chars, <= size, that contain only whole // Get the number of chars, <= size, that contain only whole
// UTF-8 codepoints. // UTF-8 codepoints.
std::size_t s = 0; std::size_t s = 0;
auto codepoint_size = utils::get_next_codepoint_size(val[pos + s]); auto codepoint_size = utils::get_next_codepoint_size(static_cast<unsigned char>(val[pos + s]));
while (s + codepoint_size <= size && pos + s < val.size()) while (s + codepoint_size <= size && pos + s < val.size())
{ {
s += codepoint_size; s += codepoint_size;
codepoint_size = utils::get_next_codepoint_size(val[pos + s]); codepoint_size = utils::get_next_codepoint_size(static_cast<unsigned char>(val[pos + s]));
} }
res.emplace_back(val.substr(pos, s)); res.emplace_back(val.substr(pos, s));
pos += s; pos += s;