INN commit: branches/2.6/backends (nntpget.c)
INN Commit
rra at isc.org
Thu Dec 10 20:27:39 UTC 2015
Date: Thursday, December 10, 2015 @ 12:27:39
Author: iulius
Revision: 9968
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:
branches/2.6/backends/nntpget.c
-----------+
nntpget.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Modified: nntpget.c
===================================================================
--- nntpget.c 2015-12-10 20:27:07 UTC (rev 9967)
+++ nntpget.c 2015-12-10 20:27:39 UTC (rev 9968)
@@ -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