Skip to contentSkip to conversation

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

DISCUSSION Helge Hafting 1 participant 1 message Sep 18, 1998 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

In <[email protected]>, on 09/18/98

Quoted 5 lines · Ian McKellar

Hi,

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

Quoted 8 lines

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.

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.

The equivalent code

              if (!((year+2) & 3) && month > 2 && year != 130) is probably

faster. The somewhat expensive mod operator is replaced by a bitwise "and", that is faster on most platforms.

Helge Hafting

Signature · 9 lines
-----------------------------------------------------------
[email protected]
-----------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/