Re: Non-urgent issue with fs/isofs/util.c

DAVID BALAZIC (david.balazic@uni-mb.si)
Fri, 18 Sep 1998 14:00:26 +0100 (MET)


In <19980918151457.C9740@harvestroad.com.au>, on 09/18/98
at 03:14 PM, Ian McKellar <imckellar@harvestroad.com.au> said:

>Hi,
>The iso_date function in fs/isofs/util.c doesn't correctly handle leap
>years.

>Well, it doesn't handle the year 2100 - which according to the code is a
>leap year, but according to the commonly accepted rules is not.

It also fails on 2200 , 2300 , 2500 ...
which are not leap years.
2400 is a leap year.

The rule again ( for those that doesn't know ) :

If ( year % 400 ) == 0 then LEAP
else if ( year % 100 ) == 0 then NOT_LEAP
else if ( year % 4 ) == 0 then LEAP
else NOT_LEAP

>I don't think we need to be to concerned right now, but changing:
> if (((year+2) % 4) == 0 && month > 2)
>to:
> if (((year+2) % 4) == 0 && month > 2 && year != 130) should
>fix it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/