summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorpjanzen <pjanzen@openbsd.org>1999-10-29 03:59:01 +0000
committerpjanzen <pjanzen@openbsd.org>1999-10-29 03:59:01 +0000
commitbf592bebfbf37227dd139a640b2caa4d8b043295 (patch)
treece8971c3f67a3b11b9f8264da3b9730ad35efea7 /games
parentetherip statistics (diff)
downloadwireguard-openbsd-bf592bebfbf37227dd139a640b2caa4d8b043295.tar.xz
wireguard-openbsd-bf592bebfbf37227dd139a640b2caa4d8b043295.zip
srandom() for variety.
Diffstat (limited to 'games')
-rw-r--r--games/rain/rain.c6
-rw-r--r--games/worms/worms.c6
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);