From 9beb6d77531ca8c180e990e59091c83fa298950b Mon Sep 17 00:00:00 2001 From: zhkag Date: Mon, 30 Oct 2023 14:37:27 +0800 Subject: [PATCH] fix rt_timespec_to_tick fun internal data overflow --- components/libc/compilers/common/ctime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c index 550b89522d6..f2cc76df477 100644 --- a/components/libc/compilers/common/ctime.c +++ b/components/libc/compilers/common/ctime.c @@ -710,7 +710,8 @@ RTM_EXPORT(clock_settime); int rt_timespec_to_tick(const struct timespec *time) { int tick; - int nsecond, second; + int second; + long long nsecond; struct timespec tp = {0}; RT_ASSERT(time != RT_NULL);