Folks,

There's a wrap-around problem that affects the implementation
of Zeller's congruence in dtime.c.  This causes the day-of-week
calculations to fail for dates after Feb 29, 2000 (probably up
until some year far in the future).

Here's a patch to fix it.

Simon.
--
Index: dtime.c
===================================================================
RCS file: /cvs/nmh/zotnet/tws/dtime.c,v
retrieving revision 1.2
diff -p -u -r1.2 dtime.c
--- dtime.c     1999/05/13 01:13:58     1.2
+++ dtime.c     2000/03/14 03:08:49
@@ -459,6 +459,8 @@ set_dotw (struct tws *tw)
     tw->tw_wday =
        ((26 * month - 2) / 10 + day + year + year / 4
            - 3 * century / 4 + 1) % 7;
+    if (tw->tw_wday < 0)
+       tw->tw_wday += 7;
 
     tw->tw_flags &= ~TW_SDAY, tw->tw_flags |= TW_SIMP;
 }

Reply via email to