From 37d0be329064a24bcc1eb7696ba57eabc7254dfd Mon Sep 17 00:00:00 2001 From: chunyexixiaoyu <834670833@qq.com> Date: Wed, 1 Jun 2022 13:50:47 +0800 Subject: [PATCH] [libc][time] solve the problem which the os tick can be calculated wrongly because the local variable was not initialized. --- components/libc/compilers/common/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 16387148f6..96591113b8 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -689,7 +689,7 @@ int rt_timespec_to_tick(const struct timespec *time) { int tick; int nsecond, second; - struct timespec tp; + struct timespec tp = {0}; RT_ASSERT(time != RT_NULL); -- GitLab