From bb34aeeb7936b0b8ab41602b2103cde70aa2467d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 6 Oct 2022 10:14:50 +0200 Subject: [PATCH] Apply Otto's suggestion (cherry picked from commit 7f73a566805979f94bc1a23c9088372e00177bec) --- pdns/misc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 + "'"); } -- 2.47.2