[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tyson Smith <tyson.w.smith@xxxxxxxxx>

---
 random.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/random.c b/random.c
index 8b4f715..8b8de04 100644
--- a/random.c
+++ b/random.c
@@ -108,10 +108,8 @@ unsigned int rand32(void)
 		r = ~r + 1;
 
 	/* we might get lucky if something is counting ints/longs etc. */
-	if (ONE_IN(4)) {
-		int _div = 1 << RAND_RANGE(1, 4);	/* 2,4,8 or 16 */
-		r /= _div;
-	}
+	if (ONE_IN(4))
+		r /= 2 << (rand() & 3); /* 2,4,8 or 16 */
 
 	/* limit the size */
 	switch (rand() % 5) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux