From 224f04cb29229002dc519bdb5dd1501110bc06f5 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Sun, 17 Oct 2021 12:15:30 +0900 Subject: [PATCH] dtcm: fix `localtime()` usage It is expexted the first argument is `*time_t`, not `time_t`. --- cde/programs/dtcm/server/rtable4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtcm/server/rtable4.c b/cde/programs/dtcm/server/rtable4.c index 3c6ca633e..e44db64c3 100644 --- a/cde/programs/dtcm/server/rtable4.c +++ b/cde/programs/dtcm/server/rtable4.c @@ -1413,6 +1413,7 @@ _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq) #if !defined(CSRG_BASED) extern long timezone; #else + time_t ctime; struct tm *t; #endif @@ -1420,7 +1421,8 @@ _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq) fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n"); #if defined(CSRG_BASED) - t = localtime(time(NULL)); + ctime = time(NULL); + t = localtime(&ctime); gmtoff = t->tm_gmtoff; #else gmtoff = timezone;