Hi loyal Creamy fans,

Sorry if you've missed me for the last year or so, but I'm back, (from the
future), now.

So, anyway, the latest commit to msdosfs_conv.c causes a small problem in
the year 2100.

The DOS end of time is 12/31/2107.  Now that we support > 2038,
msdosfs_conv.c was patched to set timestamps past this date to 1/1/1980.

However, the code to process leap years continues to use a simple:

year & 0x03 ? 365 : 366

which is broken for the year 2100.

Every year is a normal year, except every fourth year which is a leap
year, except every four-hundredth year which is a normal year.

The upshot of this is that the year 2000 WAS a leap year, even though
centinary years normally are NOT.  So, the simple test above works
for all years between 1970 and 2038.

2100 is the first year that fails this simple test.

The easiest way to fix it is to change the dos end of time to 12/31/2099.

To further complicate the algorithm for all conversions seems a bit
excessive when hopefully nobody will be using FAT so far in to the future.

(At least, whilst I was in the year 2100, I didn't notice anybody using
it).

More bugs to follow...

Creamy! <3

Reply via email to