logging: days in months calculation fix
Array 'days_in_month' of size 12 may use index value bigger then
count of its elements.
@@ -194,7 +194,7 @@ static void __attribute__((unused)) get_YMD_from_seconds(uint64_t seconds,
output_date->year++;
}
/* compute the proper month */
- for (i = 0; i < sizeof(days_in_month); i++) {
+ for (i = 0; i < ARRAY_SIZE(days_in_month); i++) {
tmp = ((i == 1) && is_leap_year(output_date->year)) ?
(days_in_month[i] + 1) * SECONDS_IN_DAY :
days_in_month[i] * SECONDS_IN_DAY;
