From ffce06718c2a462b9a1fa307d3c943304095fef9 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sun, 20 Dec 1998 20:39:08 +0000 Subject: [PATCH] fix leap year handling ... git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1461 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/register/datecell.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/register/datecell.c b/src/register/datecell.c index 96aeb35b08..2d100f52f1 100644 --- a/src/register/datecell.c +++ b/src/register/datecell.c @@ -407,8 +407,8 @@ xaccSetDateCellValueSecsL (DateCell *cell, long long secs) struct tm * stm; /* try to deal with dates earlier than December 1901 - * or later than Jan 2038. Note that this blows off - * centenial leap years. */ + * or later than Jan 2038. Note that xaccValidateDate + * should be handling centential (non-) leap years. */ if ((0x80000000L > secs) || (0x7fffffffL < secs)) { int yrs; @@ -418,6 +418,7 @@ xaccSetDateCellValueSecsL (DateCell *cell, long long secs) stm = localtime (&rem); cell->date = *stm; cell->date.tm_year += 32 * yrs; + xaccValidateDate (&(cell->date), 0); } else { /* OK, time value is an unsigned 32-bit int */ time_t sicko;