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/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F25%2Fhead;p=open-adventure.git 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 */