mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Avoid GCC error "array subscript is above array bounds" which probably considers that the unsigned char could underflow and access an element out of the months range.
This commit is contained in:
parent
6647386d30
commit
29da6850e4
@ -196,7 +196,7 @@ Uint8 Date::DaysInMonth(Uint16 year, Uint8 month)
|
||||
STHROWF("Month value is out of range: %u > 12", month);
|
||||
}
|
||||
// Obtain the days in this month
|
||||
Uint8 days = MonthLengths[month - 1];
|
||||
Uint8 days = *(MonthLengths + month);
|
||||
// Should we account for January?
|
||||
if (month == 2 && IsLeapYear(year))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user