lib: Use struct initialization
authorVolker Lendecke <vl@samba.org>
Tue, 21 May 2024 06:31:45 +0000 (08:31 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 04:23:29 +0000 (04:23 +0000)
Make sure everything is initialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/time.c

index d2bf2454e317ea67044d578a2851db73d96b6b3b..7ed8fb00447c8252f252f98cfcf46030be34d123 100644 (file)
@@ -102,9 +102,7 @@ time_t convert_timespec_to_time_t(struct timespec ts)
 
 struct timespec convert_time_t_to_timespec(time_t t)
 {
-       struct timespec ts;
-       ts.tv_sec = t;
-       ts.tv_nsec = 0;
+       struct timespec ts = {.tv_sec = t};
        return ts;
 }