From 0cbc873f5c7b5c84a5f837439026843746e1c400 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 21 Jul 2026 14:14:51 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20address=20review=20findings=20=E2=80=94?= =?UTF-8?q?=20localtime=5Fr,=20test=5Fscanner=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/log.c b/src/shared/log.c index 0479812..bc8ffed 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -14,7 +14,8 @@ void log_message(LogLevel log_level, const char* format, ...) { if (log_level < current_log_level) return; time_t now = time(NULL); - const struct tm* t = localtime(&now); + struct tm result_buf; + const struct tm* t = localtime_r(&now, &result_buf); fprintf(stderr, "%04d-%02d-%02d %02d:%02d:%02d [%s]: ", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, log_level_strings[log_level]);