[libc] [ctime] fix rt_timespec_to_tick fun internal data overflow (#8198)

This commit is contained in:
kk 2023-10-31 20:59:01 +08:00 committed by GitHub
parent a64ccaa295
commit 1d3fc71c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -710,7 +710,8 @@ RTM_EXPORT(clock_settime);
int rt_timespec_to_tick(const struct timespec *time) int rt_timespec_to_tick(const struct timespec *time)
{ {
int tick; int tick;
int nsecond, second; int second;
long long nsecond;
struct timespec tp = {0}; struct timespec tp = {0};
RT_ASSERT(time != RT_NULL); RT_ASSERT(time != RT_NULL);