diff --git a/libs/libc/time/lib_calendar2utc.c b/libs/libc/time/lib_calendar2utc.c index 41920b098e..6e66be1056 100644 --- a/libs/libc/time/lib_calendar2utc.c +++ b/libs/libc/time/lib_calendar2utc.c @@ -162,7 +162,7 @@ time_t clock_calendar2utc(int year, int month, int day) /* Add in the extra days for the leap years prior to the current year. */ - days += (year - EPOCH_YEAR - 1) >> 2; + days += (year - (EPOCH_YEAR - 1)) >> 2; /* Add in the days up to the beginning of this month. */