From e6a67b97c228b40c33775bfb819866e95f7493af Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 1 Sep 2015 11:47:30 +0300 Subject: [PATCH] Use std::distance in dnsname, fix #2721 --- pdns/dnsname.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index d9bf435fce..68d51e478d 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -112,8 +112,8 @@ bool DNSName::isPartOf(const DNSName& parent) const return false; // this is slightly complicated since we can't start from the end, since we can't see where a label begins/ends then - for(auto us=d_storage.cbegin(); us= (unsigned int)parent.d_storage.size(); us+=*us+1) { - if (d_storage.cend()-us == (unsigned int)parent.d_storage.size()) { + for(auto us=d_storage.cbegin(); us= static_cast(parent.d_storage.size()); us+=*us+1) { + if (std::distance(us,d_storage.cend()) == static_cast(parent.d_storage.size())) { auto p = parent.d_storage.cbegin(); for(; us != d_storage.cend(); ++us, ++p) { if(tolower(*p) != tolower(*us)) -- 2.47.2