]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix loops
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 13 Jun 2023 11:02:36 +0000 (13:02 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 13 Jun 2023 13:43:49 +0000 (15:43 +0200)
pdns/dns_random.cc
pdns/test-dns_random_hh.cc

index 9d3e34edc4297d20dd2cf3239ce6588be5c23c98..a8eb266c0cd0bfa6096d9a9fb1a57fee8223ee58 100644 (file)
@@ -256,6 +256,7 @@ uint32_t dns_random_uint32()
       if (got != sizeof(num)) {
         throw std::runtime_error("getrandom() failed: " + stringerror());
       }
+      break;
     } while (true);
     return num;
 #else
@@ -289,6 +290,7 @@ uint32_t dns_random_uint32()
         attempts--;
         continue;
       }
+      break;
     } while (true);
     return num;
   }
index 6a126c8a49cf19c243651f45700a646ce0c6fd99..db8a0eb0ab782aa7842a60727b20da10b2ff8c84 100644 (file)
@@ -18,7 +18,7 @@
 
 using namespace boost::accumulators;
 
-using acc_t = accumulator_set<double, stats<tag::median (with_p_square_quantile), tag::mean (immediate)>>;
+using acc_t = accumulator_set<double, stats<tag::median(with_p_square_quantile), tag::mean(immediate)>>;
 
 BOOST_AUTO_TEST_SUITE(test_dns_random_hh)
 
@@ -28,9 +28,9 @@ const std::vector<string> rndSources = {
 #if defined(HAVE_GETRANDOM)
   "getrandom",
 #endif
-  #if defined(HAVE_ARC4RANDOM)
+#if defined(HAVE_ARC4RANDOM)
   "arc4random",
-  #endif
+#endif
 #if defined(HAVE_RANDOMBYTES_STIR)
   "sodium",
 #endif
@@ -42,7 +42,6 @@ const std::vector<string> rndSources = {
 #endif
 };
 
-
 BOOST_AUTO_TEST_CASE(test_dns_random_garbage)
 {
 
@@ -127,7 +126,4 @@ BOOST_AUTO_TEST_CASE(test_dns_random_uint32_average)
   }
 }
 
-
 BOOST_AUTO_TEST_SUITE_END()
-
-