diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-08-29 20:22:23 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-08-29 20:22:23 +0000 |
commit | 8ce81dbb9ce96aff37591175c4be0778150c387c (patch) | |
tree | fe2cf8a0e8381920812ba877a940668255c15104 /games/tetris | |
parent | 514acfbf4d29506078ac09ba5d85f12a80634c1f (diff) |
replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@
Diffstat (limited to 'games/tetris')
-rw-r--r-- | games/tetris/tetris.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c index bf586a071b9..7e7bc9f281a 100644 --- a/games/tetris/tetris.c +++ b/games/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.c,v 1.23 2009/10/28 00:25:38 deraadt Exp $ */ +/* $OpenBSD: tetris.c,v 1.24 2013/08/29 20:22:20 naddy Exp $ */ /* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ /*- @@ -139,8 +139,8 @@ randshape(void) const struct shape *tmp; int i, j; - tmp = &shapes[random() % 7]; - j = random() % 4; + tmp = &shapes[arc4random_uniform(7)]; + j = arc4random_uniform(4); for (i = 0; i < j; i++) tmp = &shapes[classic? tmp->rotc : tmp->rot]; return (tmp); @@ -225,7 +225,6 @@ main(int argc, char *argv[]) scr_init(); setup_board(); - srandomdev(); scr_set(); pos = A_FIRST*B_COLS + (B_COLS/2)-1; |