diff options
author | bland <bland@FreeBSD.org> | 2004-12-06 15:38:24 +0000 |
---|---|---|
committer | bland <bland@FreeBSD.org> | 2004-12-06 15:38:24 +0000 |
commit | f31ff0ee8a56ce2bbfbcd7549fc4994a06e02b0f (patch) | |
tree | 7947e028dec932b42ae38e158aef056c23ed8993 /usr.bin | |
parent | 885c50507df63c3bc97a7c11bcb5b36954aea50c (diff) | |
download | FreeBSD-src-f31ff0ee8a56ce2bbfbcd7549fc4994a06e02b0f.zip FreeBSD-src-f31ff0ee8a56ce2bbfbcd7549fc4994a06e02b0f.tar.gz |
Fix -t option processing.
Partially initialized tm structure was passed into mktime(3).
Approved by: ru
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/calendar/day.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index c1da370..cbc1966 100644 --- a/usr.bin/calendar/day.c +++ b/usr.bin/calendar/day.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" struct tm *tp; +static const struct tm tm0; int *cumdays, offset, yrdays; char dayname[10]; @@ -179,10 +180,7 @@ time_t Mktime (dp) (void)time(&t); tp = localtime(&t); - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_wday = 0; + tm = tm0; tm.tm_mday = tp->tm_mday; tm.tm_mon = tp->tm_mon; tm.tm_year = tp->tm_year; |