summaryrefslogtreecommitdiffstats
path: root/src/fig/FIG0_9.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fig/FIG0_9.cpp')
-rw-r--r--src/fig/FIG0_9.cpp5
1 files changed, 3 insertions, 2 deletions
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, &ltime);
+ time_t now2 = timegm(&ltime);
ensemble->lto = (now2 - now) / 1800;
}