From 59dd44d30376b2834e6f46ee6242559c6365421e Mon Sep 17 00:00:00 2001 From: Alexander Nedotsukov Date: Mon, 6 Dec 2004 15:38:24 +0000 Subject: [PATCH] Fix -t option processing. Partially initialized tm structure was passed into mktime(3). Approved by: ru --- usr.bin/calendar/day.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index c1da370e9d7..cbc196655ea 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;