From: Kurt Zeilenga Date: Fri, 17 Sep 1999 22:05:51 +0000 (+0000) Subject: Apply y2k fix based upon Howard Young's (ITS#294) suggestion X-Git-Tag: UCDATA_2_4~422 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c35d53d6e0684e1204feaf9fac0b9a2ef361ff8b;p=openldap Apply y2k fix based upon Howard Young's (ITS#294) suggestion --- diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 8b480a3ef5..38fa470156 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -909,8 +909,17 @@ time2text( char *ldtimestr, int dateonly ) /* POSIX says tm_year should be year - 1900 */ t.tm_year = 100 * GET2BYTENUM( p ) - 1900; p += 2; + t.tm_year = GET2BYTENUM( p ); p += 2; + + } else { + /* came without a century */ + t.tm_year = GET2BYTENUM( p ); p += 2; + + /* Y2K hack - 2 digit years < 70 are 21st century */ + if( t.tm_year < 70 ) { + t.tm_year += 100; + } } - t.tm_year = GET2BYTENUM( p ); p += 2; t.tm_mon = GET2BYTENUM( p ) - 1; p += 2; t.tm_mday = GET2BYTENUM( p ); p += 2;