summaryrefslogtreecommitdiffstats
path: root/dm/dm.c
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-19 18:13:41 +0000
committerjsm <jsm@NetBSD.org>1999-09-19 18:13:41 +0000
commit07759656fb10ed6f20dbd6cd5aef882902014c7d (patch)
treed2acca6d3e8d42c5b198d8b7cfaf38b9620affbb /dm/dm.c
parent70abef66c638a785faabbc4e320204c950f27427 (diff)
downloadbsdgames-darwin-07759656fb10ed6f20dbd6cd5aef882902014c7d.tar.gz
bsdgames-darwin-07759656fb10ed6f20dbd6cd5aef882902014c7d.tar.zst
bsdgames-darwin-07759656fb10ed6f20dbd6cd5aef882902014c7d.zip
Allow dm to ban games playing 11pm-midnight.
From OpenBSD.
Diffstat (limited to 'dm/dm.c')
-rw-r--r--dm/dm.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/dm/dm.c b/dm/dm.c
index 80d17b0b..46071241 100644
--- a/dm/dm.c
+++ b/dm/dm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm.c,v 1.12 1999/07/14 22:52:07 hubertf Exp $ */
+/* $NetBSD: dm.c,v 1.13 1999/09/19 18:13:41 jsm Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
#if 0
static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dm.c,v 1.12 1999/07/14 22:52:07 hubertf Exp $");
+__RCSID("$NetBSD: dm.c,v 1.13 1999/09/19 18:13:41 jsm Exp $");
#endif
#endif /* not lint */
@@ -185,9 +185,13 @@ c_day(s_day, s_start, s_stop)
return;
start = atoi(s_start);
stop = atoi(s_stop);
- if (ct->tm_hour >= start && ct->tm_hour < stop)
- errx(0, "Sorry, games are not available from %s to %s today.",
- hour(start), hour(stop));
+ if (ct->tm_hour >= start && ct->tm_hour < stop) {
+ if (start == 0 && stop == 24)
+ errx(0, "Sorry, games are not available today.");
+ else
+ errx(0, "Sorry, games are not available from %s to %s today.",
+ hour(start), hour(stop));
+ }
}
/*
@@ -295,9 +299,9 @@ hour(h)
"midnight", "1am", "2am", "3am", "4am", "5am",
"6am", "7am", "8am", "9am", "10am", "11am",
"noon", "1pm", "2pm", "3pm", "4pm", "5pm",
- "6pm", "7pm", "8pm", "9pm", "10pm", "11pm" };
+ "6pm", "7pm", "8pm", "9pm", "10pm", "11pm", "midnight" };
- if (h < 0 || h > 23)
+ if (h < 0 || h > 24)
return ("BAD TIME");
else
return (hours[h]);