From 0aaa6989c86eb6f15f49faee7ab0c013ebe89171 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 28 Jan 2019 11:13:32 +0100 Subject: Use reentrant gmtime and localtime functions, and other tweaks --- src/fig/FIG0_9.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/fig/FIG0_9.cpp') diff --git a/src/fig/FIG0_9.cpp b/src/fig/FIG0_9.cpp index cf73625..dcee17c 100644 --- a/src/fig/FIG0_9.cpp +++ b/src/fig/FIG0_9.cpp @@ -139,8 +139,9 @@ FillStatus FIG0_9::fill(uint8_t *buf, size_t max_size) if (ensemble->lto_auto) { time_t now = time(NULL); - struct tm* ltime = localtime(&now); - time_t now2 = timegm(ltime); + struct tm ltime; + localtime_r(&now, <ime); + time_t now2 = timegm(<ime); ensemble->lto = (now2 - now) / 1800; } -- cgit v1.2.3