INN commit: trunk/backends (nntpget.c)

INN Commit rra at isc.org
Sat Oct 24 19:22:35 UTC 2015


    Date: Saturday, October 24, 2015 @ 12:22:35
  Author: iulius
Revision: 9954

nntpget:  NEWNEWS accepts 4-digit years

Hopefully NNTP specification is Y2K-compliant and allows 4-digit years
for the NEWNEWS command.  Fix nntpget to use that syntax.

Modified:
  trunk/backends/nntpget.c

-----------+
 nntpget.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Modified: nntpget.c
===================================================================
--- nntpget.c	2015-10-21 23:42:13 UTC (rev 9953)
+++ nntpget.c	2015-10-24 19:22:35 UTC (rev 9954)
@@ -243,10 +243,9 @@
 	    if (stat(optarg, &Sb) < 0)
                 sysdie("cannot stat %s", optarg);
 	    gt = gmtime(&Sb.st_mtime);
-	    /* Y2K: NNTP Spec currently allows only two digit years. */
-	    snprintf(tbuff, sizeof(tbuff), "%02d%02d%02d %02d%02d%02d GMT",
-		    gt->tm_year % 100, gt->tm_mon + 1, gt->tm_mday,
-		    gt->tm_hour, gt->tm_min, gt->tm_sec);
+            snprintf(tbuff, sizeof(tbuff), "%04d%02d%02d %02d%02d%02d GMT",
+                     gt->tm_year + 1900, gt->tm_mon + 1, gt->tm_mday,
+                     gt->tm_hour, gt->tm_min, gt->tm_sec);
 	    Since = tbuff;
 	    break;
 	case 'n':



More information about the inn-committers mailing list