Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 1996 13:25:48 -0700 (PDT)
From:      Matt Bartley <mbartley@lear35.cytex.com>
To:        freebsd-ports@freebsd.org
Subject:   trn-3.6 leap year bug fix
Message-ID:  <199607212025.NAA20762@lear35.cytex.com>

next in thread | raw e-mail | index | archive | help
This should go in as file /usr/ports/news/trn/patches/patches-aa:

------------------------------ 8< ------------------------------
--- nntp.c.orig	Fri Nov 18 22:01:23 1994
+++ nntp.c	Sun Jul 21 13:13:58 1996
@@ -319,8 +319,8 @@
     for (month--; month; month--)
 	day += maxdays[month];
 
-    ss = ((((year-1970) * 365 + (year-1968)/4 + day - 1) * 24L + hh) * 60
-	  + mm) * 60 + ss;
+    ss = ((((year-1970) * 365 + (year-1969)/4 + day - 1) * 24L + hh) * 60
+        + mm) * 60 + ss;
 
     return ss;
 }
------------------------------ 8< ------------------------------

The symptom of this leap year bug is that every time trn starts up, it
thinks there are new newsgroups, even when there are not.

This is a quick fix that was posted to Usenet a while ago.  This will
work properly until the year 2100 (only).  There is a longer, more
correct patch, but if anyone is still using trn-3.6 104 years from now
it would be pretty pathetic anyway.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607212025.NAA20762>