]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Apply Otto's suggestion 12173/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 6 Oct 2022 08:14:50 +0000 (10:14 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 4 Nov 2022 11:23:28 +0000 (12:23 +0100)
(cherry picked from commit 7f73a566805979f94bc1a23c9088372e00177bec)

pdns/misc.cc

index f4aec4b519b98d104e4de4a968e22c56514e30e7..908d474d6a74f9cb29cb5bac0906e961c9200f0f 100644 (file)
@@ -617,10 +617,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 + "'");
     }