summaryrefslogtreecommitdiff
path: root/sbin/shutdown
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-07 18:26:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-07 18:26:23 +0000
commitbca8ede36193523f5e509e218d1976dc9b8386e2 (patch)
tree8021052d902e951ea77cf9a839e25b3062a6b5bc /sbin/shutdown
parentf450dee1afdaa407e9eb35b9d02efd9642a245fa (diff)
major -Wall cleanup, almost complete
Diffstat (limited to 'sbin/shutdown')
-rw-r--r--sbin/shutdown/shutdown.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 4e5697a5a47..52ed7cb6f86 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shutdown.c,v 1.20 2001/01/19 17:57:43 deraadt Exp $ */
+/* $OpenBSD: shutdown.c,v 1.21 2001/07/07 18:26:22 deraadt Exp $ */
/* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94";
#else
-static char rcsid[] = "$OpenBSD: shutdown.c,v 1.20 2001/01/19 17:57:43 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: shutdown.c,v 1.21 2001/07/07 18:26:22 deraadt Exp $";
#endif
#endif /* not lint */
@@ -461,15 +461,16 @@ getoffset(timearg)
}
/* handle hh:mm by getting rid of the colon */
- for (p = timearg; *p; ++p)
- if (!isascii(*p) || !isdigit(*p))
+ for (p = timearg; *p; ++p) {
+ if (!isascii(*p) || !isdigit(*p)) {
if (*p == ':' && strlen(p) == 3) {
p[0] = p[1];
p[1] = p[2];
p[2] = '\0';
- }
- else
+ } else
badtime();
+ }
+ }
unsetenv("TZ"); /* OUR timezone */
lt = localtime(&now); /* current time val */