From 1a44ff6513450b2b1e95e06cb373489054fa89e6 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Wed, 20 Jul 2011 23:19:12 +1000 Subject: [PATCH] Replace "tv.tv_sec * tv.tv_usec" with "tv.tv_sec + tv.tv_usec" This allows the lower bits of seed to hopefully contain something useful instead of just zeros! --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 8cf68d2..ffa7f75 100644 --- a/src/utils.c +++ b/src/utils.c @@ -270,7 +270,7 @@ void init_rand (void) unsigned long int seed; gettimeofday(&tv, NULL); // If this fails, tv is random enough! - seed = tv.tv_sec * tv.tv_usec; + seed = tv.tv_sec + tv.tv_usec; srand48(seed); }