summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isc/random.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2019-12-17 01:46:30 +0000
committersthen <sthen@openbsd.org>2019-12-17 01:46:30 +0000
commit3ef32adf69b1fed9e0363dd1f2116627f09e6af3 (patch)
tree4d9d566691647dad37619d7bd9d1c7114f554bbe /usr.sbin/bind/lib/isc/random.c
parentAdd support for NCT6775F, NCT5104D, NCT6779D, NCT679[1235]D sensors. (diff)
downloadwireguard-openbsd-3ef32adf69b1fed9e0363dd1f2116627f09e6af3.tar.xz
wireguard-openbsd-3ef32adf69b1fed9e0363dd1f2116627f09e6af3.zip
update to 9.10.8-P1, last isc-licensed release
Diffstat (limited to 'usr.sbin/bind/lib/isc/random.c')
-rw-r--r--usr.sbin/bind/lib/isc/random.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bind/lib/isc/random.c b/usr.sbin/bind/lib/isc/random.c
index 1199c5eb766..888fa1da1da 100644
--- a/usr.sbin/bind/lib/isc/random.c
+++ b/usr.sbin/bind/lib/isc/random.c
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2009, 2013, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: random.c,v 1.10 2019/12/16 16:16:26 deraadt Exp $ */
+/* $Id: random.c,v 1.11 2019/12/17 01:46:34 sthen Exp $ */
/*! \file */
@@ -99,7 +98,8 @@ isc_random_get(isc_uint32_t *val)
*/
#if RAND_MAX >= 0xfffff
/* We have at least 20 bits. Use lower 16 excluding lower most 4 */
- *val = ((rand() >> 4) & 0xffff) | ((rand() << 12) & 0xffff0000);
+ *val = ((((unsigned int)rand()) & 0xffff0) >> 4) |
+ ((((unsigned int)rand()) & 0xffff0) << 12);
#elif RAND_MAX >= 0x7fff
/* We have at least 15 bits. Use lower 10/11 excluding lower most 4 */
*val = ((rand() >> 4) & 0x000007ff) | ((rand() << 7) & 0x003ff800) |