From 6fb8f6fd32aee872cec0c338c977037e97f362ba Mon Sep 17 00:00:00 2001 From: Paul Park Date: Tue, 16 May 1995 14:35:02 +0000 Subject: [PATCH] Fix nitty bug in gmt_mktime() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5818 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/gmt_mktime.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 7dbd64372..cee01f0fa 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ + +Tue May 16 10:33:03 EDT 1995 Paul Park (pjpark@mit.edu) + * gmt_mktime.c - Use the actual year instead of the number of years + since 1900 when determining if a year has a leapday. + Makes dates after February in the year 2000 correct. + Mon May 8 22:19:23 1995 Ezra Peisach * read_pwd.c (krb5_read_password): use volatile on all diff --git a/src/lib/krb5/os/gmt_mktime.c b/src/lib/krb5/os/gmt_mktime.c index 7cfeba201..1fac90a93 100644 --- a/src/lib/krb5/os/gmt_mktime.c +++ b/src/lib/krb5/os/gmt_mktime.c @@ -65,7 +65,7 @@ time_t gmt_mktime(t) accum += (t->tm_year - 69) / 4; /* add in leap day for this year */ if(t->tm_mon >= 2) /* march or later */ - if(hasleapday(t->tm_year)) accum += 1; + if(hasleapday((t->tm_year + 1900))) accum += 1; accum += days_in_month[t->tm_mon]; accum += t->tm_mday-1; /* days of month are the only 1-based field */ -- 2.26.2