From: Pieter Lexis Date: Thu, 29 Nov 2018 10:15:21 +0000 (+0100) Subject: auth: Fix final nit for dns_random X-Git-Tag: auth-4.2.0-alpha1~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5988%2Fhead;p=thirdparty%2Fpdns.git auth: Fix final nit for dns_random --- diff --git a/pdns/dns_random.cc b/pdns/dns_random.cc index 58426facec..58f3c9caae 100644 --- a/pdns/dns_random.cc +++ b/pdns/dns_random.cc @@ -224,7 +224,7 @@ uint32_t dns_random(uint32_t upper_bound) { On applicable rngs, we loop until the rng spews out value larger than min, and then take modulo out of that. */ -#if (UINT32_MAX > 0xffffffffUL) +#if (ULONG_MAX > 0xffffffffUL) min = 0x100000000UL % upper_bound; #else /* Calculate (2**32 % upper_bound) avoiding 64-bit math */