From: Remi Gacogne Date: Thu, 6 Oct 2022 08:14:50 +0000 (+0200) Subject: Apply Otto's suggestion X-Git-Tag: rec-4.8.0-beta2~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb34aeeb7936b0b8ab41602b2103cde70aa2467d;p=thirdparty%2Fpdns.git Apply Otto's suggestion (cherry picked from commit 7f73a566805979f94bc1a23c9088372e00177bec) --- diff --git a/pdns/misc.cc b/pdns/misc.cc index 753821ccb7..3e98d332a0 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -601,10 +601,9 @@ string makeBytesFromHex(const string &in) { string ret; ret.reserve(in.size() / 2); - unsigned int num; for (size_t i = 0; i < in.size(); i += 2) { const auto numStr = in.substr(i, 2); - num = 0; + unsigned int num = 0; if (sscanf(numStr.c_str(), "%02x", &num) != 1) { throw std::range_error("Invalid value while parsing the hex string '" + in + "'"); }