Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[hylafax-users] Re: Y2K bug in xferfaxstats from hylafax 4.1beta2
This patch doesn't apply to my version (4.1beta2-5)... here's the
appropriate section:
function cvtDateTime(s)
{
yday = substr(s,7,2)
if (yday < 70)
yday += 30;
else
yday -= 70;
yday = yday*365 + substr(s,4,2) - 1;
mon = substr(s,1,2) + 0;
for (i = 0; i < mon; i++)
yday += daysInMonth[i];
return yday*FULLDAY + cvtTime(substr(s,10) ":00");
}
Was this Y2K bug already fixed in this (although differently)?
Lee Howard
At 12:41 PM 7/11/00 +0200, Uwe Koloska wrote:
>Hello,
>
>there is a Y2K bug in xferfaxstats, that prevents old faxes from 19xx be
>considered obsolete. The function for converting a date into seconds only
>takes the last two digits of the year and thus all years 20xx are smaller
>than 19xx ...
>
>Here is the patch to correct this:
>
>------------------------------------------------------------------
>--- xferfaxstats.orig Tue Jul 11 12:38:46 2000
>+++ xferfaxstats Tue Jul 11 12:39:45 2000
>@@ -197,6 +197,10 @@
> if( year <=70 ) {
> year += 100;
> }
>+ year = substr(s,7,2);
>+ if (year < 50) {
>+ year = year + 100;
>+ }
> yday = year*365 + substr(s,4,2) - 1;
> mon = substr(s,0,2) + 0;
> for (i = 0; i < mon; i++)
>------------------------------------------------------------------
>
>It uses the common windowing method to map 00--49 onto 2000--2049 and
>50--99 onto 1950--1999.
>
>Hope this helps
>Uwe Koloska
____________________ HylaFAX(tm) Users Mailing List _______________________
To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null