diff options
author | dholland <dholland@NetBSD.org> | 2008-01-28 05:48:57 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2008-01-28 05:48:57 +0000 |
commit | 5c66e02d89d57ecc63fccd60c80411d741a722e0 (patch) | |
tree | fee98dde849ac1600ab875e20bea24ece92a6c7d /larn/io.c | |
parent | e30950ccc7c7c31c69f1d31c16b0212bbf168ceb (diff) | |
download | bsdgames-darwin-5c66e02d89d57ecc63fccd60c80411d741a722e0.tar.gz bsdgames-darwin-5c66e02d89d57ecc63fccd60c80411d741a722e0.tar.zst bsdgames-darwin-5c66e02d89d57ecc63fccd60c80411d741a722e0.zip |
Call srandom() as well as initializing the private random generator
(which is crappy and should be removed, but that's for another day...)
This way e.g. fortune cookies no longer appear always in the same order.
Diffstat (limited to 'larn/io.c')
-rw-r--r-- | larn/io.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.19 2008/01/28 05:38:54 dholland Exp $ */ +/* $NetBSD: io.c,v 1.20 2008/01/28 05:48:57 dholland Exp $ */ /* * io.c Larn is copyrighted 1986 by Noah Morgan. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: io.c,v 1.19 2008/01/28 05:38:54 dholland Exp $"); +__RCSID("$NetBSD: io.c,v 1.20 2008/01/28 05:48:57 dholland Exp $"); #endif /* not lint */ #include "header.h" @@ -211,6 +211,7 @@ newgame() for (p = c, pe = c + 100; p < pe; *p++ = 0); time(&initialtime); seedrand(initialtime); + srandom(initialtime); lcreat((char *) 0); /* open buffering for output to terminal */ } |