diff options
| author | chunyexixiaoyu <[email protected]> | 2022-06-01 13:50:47 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-06-08 14:34:04 +0800 |
| commit | 37d0be329064a24bcc1eb7696ba57eabc7254dfd (patch) | |
| tree | cf184e9878a30a5393f62fa2515792c78adf3d4e /components/libc/compilers/common/time.c | |
| parent | a9dce72915360e8dfb5d442d8e58a778c1f0a80c (diff) | |
[libc][time] solve the problem which the os tick can be calculated wrongly because the local variable was not initialized.
Diffstat (limited to 'components/libc/compilers/common/time.c')
| -rw-r--r-- | components/libc/compilers/common/time.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
