logo

utils-std

Collection of commonly available Unix tools
commit: 8e9c5e6d65bff98f5c6b6371f42da0e7f7d6c54e
parent e7c1d18807f1d4385096b7d81968928860263a2c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 26 Jul 2024 10:34:55 +0200

cmd/date: Initialize struct tm

Diffstat:

Mcmd/date.c12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/cmd/date.c b/cmd/date.c @@ -33,7 +33,17 @@ int main(int argc, char *argv[]) { char outstr[BUFSIZ]; - struct tm tm; + struct tm tm = { + .tm_year = 0, + .tm_mon = 0, + .tm_mday = 0, + .tm_hour = 0, + .tm_min = 0, + .tm_sec = 0, + .tm_isdst = -1, // unknown if DST is in effect + .tm_gmtoff = 0, + .tm_zone = NULL, + }; struct timespec tp = { .tv_sec = 0, .tv_nsec = 0,