summaryrefslogtreecommitdiff
path: root/games/backgammon
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-12-06 21:48:53 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-12-06 21:48:53 +0000
commit99f7d832e358aafae4a20e767b7ff31210c4887d (patch)
tree0d21178d992de6b4ae212bcdf5ad9cef92f9ee18 /games/backgammon
parent9e9e683c581c45c1caca670660c0bb9d1906a95d (diff)
Replace things like srandom(time(NULL)) with srandomdev(3). random(3)
good enough for games but we should at least use a decent seed. pjanzen@ OK
Diffstat (limited to 'games/backgammon')
-rw-r--r--games/backgammon/backgammon/main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c
index 796bb03532e..0d268804941 100644
--- a/games/backgammon/backgammon/main.c
+++ b/games/backgammon/backgammon/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.11 2002/05/31 03:40:00 pjanzen Exp $ */
+/* $OpenBSD: main.c,v 1.12 2002/12/06 21:48:50 millert Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.11 2002/05/31 03:40:00 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.12 2002/12/06 21:48:50 millert Exp $";
#endif
#endif /* not lint */
@@ -105,7 +105,6 @@ main (argc,argv)
{
int i,l; /* non-descript indices */
char c; /* non-descript character storage */
- long t; /* time for random num generator */
signal(SIGINT, getout); /* trap interrupts */
initcurses();
@@ -120,8 +119,7 @@ main (argc,argv)
/* use whole screen for text */
begscr = 0;
- t = time(NULL);
- srandom(t); /* 'random' seed */
+ srandomdev(); /* seed random number generator */
getarg(argc, argv);
args[acnt] = '\0';