HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

FW: WARNING! Hylafax Y2K bug found



I tried sending this a couple of days ago, but I'm not sure it hit the list.
I've checked www.hylafax.org and my note wasn't in the archive. Also, the
web page still claims there are no Y2K issues known.

I'd like to take this oportunity to ask that SOMEONE take all of the known
patches (obviously including this Y2K patch) and roll them into the main
release, perhaps calling it 4.1 or maybe even 4.0PL3.

-----Original Message-----
From: Ken Cornetet [mailto:kcornet@kimball.com]
Sent: Tuesday, May 11, 1999 4:17 PM
To: flexfax@sgi.com
Subject: WARNING! Hylafax Y2K bug found


In the course of my Y2K testing of Hylafax 4.0pl2 I've found a rather nasty
little bug. This isn't a Y2K bug per se, but 2000 is a year which will
trigger it.

In util/AtSyntax.c++ there is a very carefully constructed macro for
determining if a passed year is leap year. Unfortunately, everytime it is
called, it is called with the tm_year element of a tm struct which is
actually year - 1900. This caused Hylafax to miss the fact that 2000 IS a
leap year. To prove to yourself, set your test system's time to Feb 29th
2000 (or later in the year) and send a fax with the "-a" option (such as -a
now). The fax will be scheduled for the next day.

Here's the correct macro (split for readability):

#define isLeapYear(y)   ((((y)+TM_YEAR_BASE) % 4) == 0 && \
                         (((y)+TM_YEAR_BASE) % 100) != 0 || \
                         (((y)+TM_YEAR_BASE) % 400) == 0)

--
Ken Cornetet Kimball Electronics Group 812.634.4482
Good, Fast, Cheap - Pick Two.




Project hosted by iFAX Solutions