Module Name: src
Committed By: dholland
Date: Mon Jun 27 08:46:04 UTC 2016
Modified Files:
src/games/snake/snake: snake.c
Log Message:
Do not pass usleep() values >= 1 million. From Henning Petersen in PR 51286
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/games/snake/snake/snake.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/snake/snake/snake.c
diff -u src/games/snake/snake/snake.c:1.28 src/games/snake/snake/snake.c:1.29
--- src/games/snake/snake/snake.c:1.28 Tue Jun 19 05:46:09 2012
+++ src/games/snake/snake/snake.c Mon Jun 27 08:46:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $ */
+/* $NetBSD: snake.c,v 1.29 2016/06/27 08:46:04 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $");
+__RCSID("$NetBSD: snake.c,v 1.29 2016/06/27 08:46:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -97,6 +97,7 @@ struct point {
#endif
#define pchar(point, c) mvaddch((point)->line + 1, (point)->col + 1, (c))
+/* note t must be < 20 due to restrictions of usleep() */
#define delay(t) usleep(t * 50000);
static struct point you;
@@ -892,7 +893,8 @@ pushsnake(void)
bonus = ((random() >> 8) & 0377) % 10;
mvprintw(lcnt + 1, 0, "%d\n", bonus);
refresh();
- delay(30);
+ delay(15);
+ delay(15);
if (bonus == i) {
spacewarp(1);
logit("bonus");