[ctime] 避免时区为负数时引入的隐式转换问题

This commit is contained in:
TangZhenye 2023-08-29 09:55:38 +08:00 committed by Meco Man
parent ba0cb59797
commit 810da67b6f
1 changed files with 2 additions and 2 deletions

View File

@ -475,9 +475,9 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
{
tz->tz_dsttime = DST_NONE;
#if defined(RT_LIBC_USING_LIGHT_TZ_DST)
tz->tz_minuteswest = -(rt_tz_get() / 60U);
tz->tz_minuteswest = -(rt_tz_get() / 60);
#else
tz->tz_minuteswest = 0U;
tz->tz_minuteswest = 0;
#endif /* RT_LIBC_USING_LIGHT_TZ_DST */
}