Fix -t option processing.

Partially initialized tm structure was passed into mktime(3).

Approved by:	ru
This commit is contained in:
Alexander Nedotsukov 2004-12-06 15:38:24 +00:00
parent a82682c493
commit 59dd44d303
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138456

View File

@ -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;