diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1999-10-29 03:59:07 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1999-10-29 03:59:07 +0000 |
commit | 3031e759e4f1015a4d016f6d1d288472d6e7f1dd (patch) | |
tree | c1efd8faf4c8470ab86f1e338305d50775740276 | |
parent | ada8046059288501276f4440523f531e7de5f58a (diff) |
srandom() for variety.
-rw-r--r-- | games/rain/rain.c | 6 | ||||
-rw-r--r-- | games/worms/worms.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/games/rain/rain.c b/games/rain/rain.c index 201e9bb6bb4..04b7583a4bc 100644 --- a/games/rain/rain.c +++ b/games/rain/rain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rain.c,v 1.7 1998/09/15 05:29:48 pjanzen Exp $ */ +/* $OpenBSD: rain.c,v 1.8 1999/10/29 03:59:01 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)rain.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: rain.c,v 1.7 1998/09/15 05:29:48 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: rain.c,v 1.8 1999/10/29 03:59:01 pjanzen Exp $"; #endif #endif /* not lint */ @@ -61,6 +61,7 @@ static char rcsid[] = "$OpenBSD: rain.c,v 1.7 1998/09/15 05:29:48 pjanzen Exp $" #include <string.h> #include <term.h> #include <termios.h> +#include <time.h> #include <unistd.h> #define cursor(c, r) tputs(tgoto(CM, c, r), 1, fputchar) @@ -109,6 +110,7 @@ main(argc, argv) exit(1); } + srandom(time((time_t *)NULL)); if (!(term = getenv("TERM"))) errx(1, "TERM: parameter not set"); if (!(mp = malloc((u_int)1024))) diff --git a/games/worms/worms.c b/games/worms/worms.c index 72b834d2cf1..b5c0296209a 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: worms.c,v 1.8 1998/08/19 07:42:24 pjanzen Exp $ */ +/* $OpenBSD: worms.c,v 1.9 1999/10/29 03:59:06 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)worms.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: worms.c,v 1.8 1998/08/19 07:42:24 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: worms.c,v 1.9 1999/10/29 03:59:06 pjanzen Exp $"; #endif #endif /* not lint */ @@ -71,6 +71,7 @@ static char rcsid[] = "$OpenBSD: worms.c,v 1.8 1998/08/19 07:42:24 pjanzen Exp $ #include <stdio.h> #include <stdlib.h> #include <term.h> +#include <time.h> #include <unistd.h> static struct options { @@ -254,6 +255,7 @@ main(argc, argv) exit(1); } + srandom(time((time_t *)NULL)); if (!(term = getenv("TERM"))) { (void)fprintf(stderr, "worms: no TERM environment variable.\n"); exit(1); |