From: Jason S. Ninneman Date: Tue, 30 May 2017 18:06:53 +0000 (-0700) Subject: Launder seed generation through rand() to ensure seed diversity. X-Git-Tag: seed~3 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=71fcc814f83c25847ebd703c265983cb6578d9b3;hp=dfe04a58b6a12342e1647378c823f07f7d278320 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. --- 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 */