diff --git a/subsys/logging/log_output.c b/subsys/logging/log_output.c index b1173a97c22..2d0a6a978cb 100644 --- a/subsys/logging/log_output.c +++ b/subsys/logging/log_output.c @@ -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;