diff options
author | dholland <dholland@NetBSD.org> | 2009-05-25 00:37:27 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-05-25 00:37:27 +0000 |
commit | 072f2a0f5b6a9a8b0eb6499bc8454af374cf2e99 (patch) | |
tree | 47ebfbfaa5df8a91968b387db92876d37b0564d8 /trek/main.c | |
parent | 4c730d8ae51ddaf389942c8451278b1b6de2d205 (diff) | |
download | bsdgames-darwin-072f2a0f5b6a9a8b0eb6499bc8454af374cf2e99.tar.gz bsdgames-darwin-072f2a0f5b6a9a8b0eb6499bc8454af374cf2e99.tar.zst bsdgames-darwin-072f2a0f5b6a9a8b0eb6499bc8454af374cf2e99.zip |
Use random() instead of rand(), so we get something like random
numbers out.
This changes the "tournament codes"; that is, the same code will give
you a different game now from what it used to. (This is because the
codes are basically random seeds.) I really really doubt anyone cares
about this, especially since the tournament feature appears to be
undocumented.
Diffstat (limited to 'trek/main.c')
-rw-r--r-- | trek/main.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/trek/main.c b/trek/main.c index bbf327db..3c55293f 100644 --- a/trek/main.c +++ b/trek/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.21 2009/05/25 00:29:08 dholland Exp $ */ +/* $NetBSD: main.c,v 1.22 2009/05/25 00:37:27 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,13 +39,12 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: main.c,v 1.21 2009/05/25 00:29:08 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.22 2009/05/25 00:37:27 dholland Exp $"); #endif #endif /* not lint */ #include <stdio.h> #include <setjmp.h> -#include <termios.h> #include <stdlib.h> #include <unistd.h> #include <err.h> @@ -165,8 +164,6 @@ int main(int, char **); int main(int argc, char **argv) { - time_t curtime; - long vect; int ch; /* Revoke setgid privileges */ @@ -175,9 +172,7 @@ main(int argc, char **argv) /* Default to fast mode */ Etc.fast = 1; - time(&curtime); - vect = (long) curtime; - srand(vect); + srandom((long) time(NULL)); while ((ch = getopt(argc, argv, "fst")) != -1) { switch (ch) { |