From: Aki Tuomi Date: Tue, 23 Dec 2014 16:31:41 +0000 (+0200) Subject: Coverity fixes X-Git-Tag: rec-3.7.0-rc1~86^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1980%2Fhead;p=thirdparty%2Fpdns.git Coverity fixes --- diff --git a/pdns/ext/yahttp/yahttp/reqresp.hpp b/pdns/ext/yahttp/yahttp/reqresp.hpp index 17ee9f52eb..0643c4e72d 100644 --- a/pdns/ext/yahttp/yahttp/reqresp.hpp +++ b/pdns/ext/yahttp/yahttp/reqresp.hpp @@ -52,7 +52,7 @@ namespace YaHTTP { std::string::size_type i,cl; for(i=0;ibody.length();i+=1024) { cl = std::min(static_cast(1024), doc->body.length()-i); // for less than 1k blocks - os << std::hex << cl << "\r\n"; + os << std::hex << cl << std::dec << "\r\n"; os << doc->body.substr(i, cl) << "\r\n"; } os << 0 << "\r\n\r\n"; // last chunk @@ -82,7 +82,7 @@ namespace YaHTTP { ifs.read(buf, sizeof buf); n += (k = ifs.gcount()); if (k) { - if (chunked) os << std::hex << k << "\r\n"; + if (chunked) os << std::hex << k << std::dec << "\r\n"; os.write(buf, k); if (chunked) os << "\r\n"; } diff --git a/pdns/ext/yahttp/yahttp/utility.hpp b/pdns/ext/yahttp/yahttp/utility.hpp index 03fc4833b5..3b0a8d1d9a 100644 --- a/pdns/ext/yahttp/yahttp/utility.hpp +++ b/pdns/ext/yahttp/yahttp/utility.hpp @@ -12,8 +12,10 @@ namespace YaHTTP { std::string::const_iterator lhi = lhs.begin(); std::string::const_iterator rhi = rhs.begin(); for(;lhi != lhs.end() && rhi != rhs.end(); lhi++, rhi++) - if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0; - return (::tolower(*lhi) - ::tolower(*rhi))<0; + if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0; + if (lhi == lhs.end() && rhi != rhs.end()) return true; + if (lhi != lhs.end() && rhi == rhs.end()) return false; + return false; // they are equal } };