aboutsummaryrefslogtreecommitdiff
path: root/sbin/shutdown
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-01-02 09:02:42 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-01-02 09:02:42 +0000
commit7d3df1907a893a5195cfab753ca4233c52827a5c (patch)
tree7c643d078c2473a68985d2508ae2f22f6bd6807a /sbin/shutdown
parent8befcf7be199ab5e496593cb563a3a7b9e0170e9 (diff)
downloadsrc-7d3df1907a893a5195cfab753ca4233c52827a5c.tar.gz
src-7d3df1907a893a5195cfab753ca4233c52827a5c.zip
shutdown: Fix r327476 by adding init
Initialize maybe_today. While here sort. PR: 32411 Additionally reported by: rgrimes, ian
Notes
Notes: svn path=/head/; revision=327488
Diffstat (limited to 'sbin/shutdown')
-rw-r--r--sbin/shutdown/shutdown.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 622b99fa2fa3..67a433b8edde 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -431,7 +431,7 @@ getoffset(char *timearg)
struct tm *lt;
char *p;
time_t now;
- int this_year, maybe_today;
+ int maybe_today, this_year;
char *timeunit;
(void)time(&now);
@@ -482,6 +482,7 @@ getoffset(char *timearg)
unsetenv("TZ"); /* OUR timezone */
lt = localtime(&now); /* current time val */
+ maybe_today = 1;
switch(strlen(timearg)) {
case 10: