home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / bsd / 11970 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!udel!darwin.sura.net!newsserver.jvnc.net!gmd.de!Germany.EU.net!mcsun!news.funet.fi!fuug!kiae!newsserv
  2. From: "Andrew A. Chernov, Black Mage" <ache@astral.msk.su>
  3. Newsgroups: comp.unix.bsd
  4. Subject: [386bsd] New patch00071 is slightly wrong
  5. Date: Wed, 27 Jan 93 15:50:34 +0300
  6. Distribution: world
  7. Organization: Ha-oh-lahm Yetzirah
  8. Message-ID: <bIQKePhq40@astral.msk.su>
  9. Sender: news-service@newcom.kiae.su
  10. Reply-To: ache@astral.msk.su
  11. Lines: 18
  12.  
  13. I just look into new patch00071 of clock.c and found small bug,
  14. it don't calculate leap year properly, produce error in 2000 year.
  15.  
  16. !     if (sec < 1970)
  17. !         sec += 100;
  18. !     leap = !(sec % 4); sec = ytos(sec); /* year    */
  19.  
  20. Correct way to calculate leap year is:
  21.  
  22. #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
  23.  
  24. see for example /usr/include/tzfile.h
  25. -- 
  26. In-This-Life:  Andrew A. Chernov    |  "Hay mas dicha, mas contento
  27. Internet:      ache@astral.msk.su   |  "Que adorar una hermosura
  28. FIDOnet:       2:5020/23.34         |  "Brujuleada entre los lejos
  29. Organization:  The RELCOM Corp.     |  "De lo imposible?!"  (Calderon)
  30.  
  31.