From 1f0da065385e1345f1201e6c1130adcc0bdcb6fe Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 14 Nov 2010 14:59:53 +0100 Subject: pattern_sim: Make random numbers really random --- src/pattern_sim.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/pattern_sim.c b/src/pattern_sim.c index a1c72ef4..bcbefdf5 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -273,6 +273,16 @@ int main(int argc, char *argv[]) } + /* FIXME: Make this optional */ + if ( 1 ) { + FILE *fh; + unsigned int seed; + fh = fopen("/dev/urandom", "r"); + fread(&seed, sizeof(seed), 1, fh); + fclose(fh); + srand(seed); + } + if ( filename == NULL ) { filename = strdup("molecule.pdb"); } -- cgit v1.2.3