From 7b390cb636899582243e4daa8edbdb30d686d9fb Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 26 Apr 2024 17:19:18 +0200 Subject: [PATCH] date: Fix tests by initializing timespec structure The tests related to nanosecond support were failing on amd64 due to uninitialized timespec structure. Fixes: eeb04a736cb9 date: Add support for nanoseconds Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D44975 --- bin/date/date.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/date/date.c b/bin/date/date.c index ccd72cb9844..718c94601dd 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -96,6 +96,8 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); rflag = 0; Iflag = jflag = Rflag = 0; + ts.tv_sec = 0; + ts.tv_nsec = 0; while ((ch = getopt(argc, argv, "f:I::jnRr:uv:z:")) != -1) switch((char)ch) { case 'f': -- 2.45.0