string ret;
ret.reserve(label.size()+4);
for(const auto & part : parts) {
- if(!root.empty() && !strncasecmp(root.c_str(), label.c_str() + part.first, 1 + label.length() - part.first)) { // also match trailing 0, hence '1 +'
+ auto label_part = std::string_view(label.c_str() + part.first, 1 + label.length() - part.first); // also match trailing 0, hence '1 +'
+ if(!root.empty() && pdns_ilexicographical_compare_three_way(root, label_part) == 0) {
const unsigned char rootptr[2]={0xc0,0x11};
ret.append((const char *) rootptr, 2);
return ret;