From 7918636f05b058cf621cca1e6772e427b5eb736e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 12 Nov 2010 17:02:17 -0800 Subject: [PATCH] random: Fix random number generator. As written, this "32-bit" random number generator nevers returns a value bigger than 0xfffe0. This fixes the problem. --- lib/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/random.c b/lib/random.c index 88ddb4a5..7f892514 100644 --- a/lib/random.c +++ b/lib/random.c @@ -103,7 +103,7 @@ static uint32_t random_next(void) { seed ^= seed << 13; - seed >>= 17; + seed ^= seed >> 17; seed ^= seed << 5; return seed; -- 2.30.2