Fixed index into RTC days_in_month tables. Patch from Tale.
This commit is contained in:
parent
e7d33dd76a
commit
7fcb437f29
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue