Fixed index into RTC days_in_month tables. Patch from Tale.

This commit is contained in:
SarahW 2019-01-12 16:49:44 +00:00
commit 7fcb437f29
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ static int rtc_is_leap(int org_year)
static int rtc_get_days(int org_month, int org_year)
{
if (org_month != 2)
return rtc_days_in_month[org_month];
return rtc_days_in_month[org_month-1];
else
return rtc_is_leap(org_year) ? 29 : 28;
}

View file

@ -37,7 +37,7 @@ static int rtc_is_leap(int org_year)
static int rtc_get_days(int org_month, int org_year)
{
if (org_month != 2)
return rtc_days_in_month[org_month];
return rtc_days_in_month[org_month-1];
else
return rtc_is_leap(org_year) ? 29 : 28;
}