IBM / IBM-Z-zOS

The helpful and handy location for finding and sharing z/OS files, which are not included in the product.
Apache License 2.0
386 stars 183 forks source link

z/OS SMF84FMT.c leap year error #274

Open ma01417 opened 5 months ago

ma01417 commented 5 months ago

Hi, I've foun a little problem in the format_smfdate() function, the following code snippet don't consider all leap years:

  /* convert julian date into sane date */
  if ((year % 4 == 0) && ((year % 100 == 0) && (year % 400 == 0)))
    month_days[1] += 1;

I suggest the correction :

  /* convert julian date into sane date */
  if ((year % 4 == 0) && **!**((year % 100 == 0) && (year % 400 == 0)))
    month_days[1] += 1;

TIA

ma01417 commented 5 months ago

Sorry, my first issue :(

The code is / convert julian date into sane date / if ((year % 4 == 0) && !((year % 100 == 0) && (year % 400 == 0))) month_days[1] += 1;