diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bind/lib/isc/random.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/isc/random.c b/usr.sbin/bind/lib/isc/random.c index 0cb8a0906f5..ac9bde7b8cb 100644 --- a/usr.sbin/bind/lib/isc/random.c +++ b/usr.sbin/bind/lib/isc/random.c @@ -114,8 +114,8 @@ isc_random_uniform(isc_uint32_t upper_bound) if (upper_bound > 0x80000000) min = 1 + ~upper_bound; /* 2**32 - upper_bound */ else { - /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */ - min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound; + /* (2**32 - x) % x == 2**32 % x when x <= 2**31 */ + min = ((0xffffffff - upper_bound) + 1) % upper_bound; } #endif |