Преглед на файлове

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

kk преди 1 година
родител
ревизия
1d3fc71c79
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      components/libc/compilers/common/ctime.c

+ 2 - 1
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);