From cc76a97fd2f4fbfe07498f57d5493d7f7fa68de4 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Tue, 3 Sep 2024 22:26:37 +0200 Subject: [PATCH] Do bit shifting with 64 bit precision --- src/utils/rng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/rng.c b/src/utils/rng.c index ca3188cc3..397bbfcd4 100644 --- a/src/utils/rng.c +++ b/src/utils/rng.c @@ -182,18 +182,18 @@ static uint64_t rand_digits(uint64_t n) /* odd random number for low order digit */ u = (rand_msws32_r(&s) % 8) * 2 + 1; - v = (1<0;) { j = rand_msws32_r(&s); /* get 8 digit 32-bit random word */ for (i=0;i<32;i+=4) { k = (j>>i) & 0xf; /* get a digit */ - if (k!=0 && (c & (1<