From b77e14a6ae28f7730b6e9caf5f6da8b293221637 Mon Sep 17 00:00:00 2001 From: "Jason S. Ninneman" Date: Tue, 30 May 2017 11:06:53 -0700 Subject: [PATCH] Launder seed generation through rand() to ensure seed diversity. This doesn't affect reproducibility because a) the seed value written to logs is the output of this process, and b) the argument to the seed command *doesn't* get laundered. --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 7a065b2..653b744 100644 --- a/main.c +++ b/main.c @@ -110,7 +110,8 @@ int main(int argc, char *argv[]) { lcgstate.a = 1093; lcgstate.c = 221587; lcgstate.m = 1048576; - long seedval = (long)time(NULL); + srand(time(NULL)); + long seedval = (long)rand(); set_seed(seedval); /* Read the database if we have not yet done so */