[Date Prev][Date Next]
Re: Y2K bugs in OpenLDAP (ITS#233)
> I suspect that the above macro exists because it works regardless of if
> you have already adjusted for the date or not. Thus it returns the correct
> year if you say that the current date is 22/07/99 and it returns the correct
> year if you say that the current date is 22/07/1999. Note that the
> above macro works with tm_year but also works with true year values as well.
Right, but it's only used with tm_year values. (I've seen code that
shoves tm_year + 1900 (the true year) into the tm_year member of a
struct tm -- truly A Bad Idea.)
> I've seen worse. I ran into a macro about a year ago which was:
> ((y) < 100 ? (y) + 1900 : (y))
> which is truly and honestly broken after 99.
Yes, there's a close equivalent to that in the UMich-LDAP version
Personally I think we should go back to Roman numerals. Of course,
then we'd get YMM bugs in code that *doesn't* handle 2-digit years.
Keith Thompson, San Diego Supercomputer Center firstname.lastname@example.org
<http://www.sdsc.edu/~kst/> Office: 858-822-0853 Fax: 858-534-5077
One of the great tragedies of ancient history is that Helen of Troy
lived before the invention of the champagne bottle.