From 44e7ddc2edfdaec0a2d9344ea5f754b176deaa36 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 24 May 2017 11:57:53 -0400 Subject: [PATCH] Take srand()/rand() out of the initialization chain... ...they're not guatanteed to produce consistent across platforms or libc versions. --- misc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc.c b/misc.c index e025c78..495a339 100644 --- a/misc.c +++ b/misc.c @@ -761,8 +761,7 @@ long TSTBIT; void set_seed(long seedval) { - srand(seedval); - lcgstate.x = (unsigned long) rand() % lcgstate.m; + lcgstate.x = (unsigned long) seedval % lcgstate.m; } unsigned long get_next_lcg_value(void) -- 2.31.1