]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
year-2000 fix (Henrik Nordstrom)
authorwessels <>
Sat, 2 May 1998 04:37:14 +0000 (04:37 +0000)
committerwessels <>
Sat, 2 May 1998 04:37:14 +0000 (04:37 +0000)
lib/iso3307.c

index 420cb59772c2b2f62391658072706555fe1663b4..5aa7db4777e2d5523d1f2cd7e433a258ea87d337 100644 (file)
@@ -33,7 +33,8 @@ parse_iso3307_time(const char *buf)
     if ((int) strlen(buf) < 14)
        return 0;
     memset(&tms, '\0', sizeof(struct tm));
-    tms.tm_year = (ASCII_DIGIT(buf[2]) * 10) + ASCII_DIGIT(buf[3]);
+    tms.tm_year = (ASCII_DIGIT(buf[0]) * 1000) + (ASCII_DIGIT(buf[1]) * 100) +
+       (ASCII_DIGIT(buf[2]) * 10) + ASCII_DIGIT(buf[3]) - 1900;
     tms.tm_mon = (ASCII_DIGIT(buf[4]) * 10) + ASCII_DIGIT(buf[5]) - 1;
     tms.tm_mday = (ASCII_DIGIT(buf[6]) * 10) + ASCII_DIGIT(buf[7]);
     tms.tm_hour = (ASCII_DIGIT(buf[8]) * 10) + ASCII_DIGIT(buf[9]);