]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Apply Otto's suggestion 12172/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:21:38 +0000 (12:21 +0100)
(cherry picked from commit 7f73a566805979f94bc1a23c9088372e00177bec)

pdns/misc.cc

index b2b9f0bd3447dac9c3486ee2c0836f498fce86f6..77a31fe138070ffa700fd49a5cc6ac182bf6a9f2 100644 (file)
@@ -584,10 +584,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 + "'");
     }