mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
Apply ITS#294 y2k fix
This commit is contained in:
parent
b412195a95
commit
257810afe4
2 changed files with 11 additions and 1 deletions
1
CHANGES
1
CHANGES
|
|
@ -3,6 +3,7 @@ OpenLDAP Change Log
|
|||
Changes included in OpenLDAP 1.2 Release Engineering
|
||||
CVS Tag: OPENLDAP_REL_ENG_1_2
|
||||
Fixed slapd lint
|
||||
Fixed -lldap templates y2k bug (ITS#294)
|
||||
|
||||
Changes included in OpenLDAP 1.2.7
|
||||
CVS Tag: OPENLDAP_REL_ENG_1_2_7
|
||||
|
|
|
|||
|
|
@ -900,8 +900,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue