HylaFAX The world's most advanced open source fax server

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

[hylafax-users] Y2K bug in xferfaxstats from hylafax 4.1beta2



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

-- 
mailto:koloska@rcs.urz.tu-dresden.de
http://rcswww.urz.tu-dresden.de/~koloska/
--                                    --
right now the web page is in german only
but this will change as time goes by ;-)


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null




Project hosted by iFAX Solutions