logo

utils-std

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

cmd/touch: Initialize struct tm iso_res

Diffstat:

Mcmd/touch.c13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/cmd/touch.c b/cmd/touch.c @@ -158,8 +158,17 @@ main(int argc, char *argv[]) case 'd': { long nsec = 0; - struct tm iso_res; - + struct tm iso_res = { + .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, + }; char *s = iso_parse(optarg, &iso_res, &nsec, &errstr); if(errstr != NULL) {