From 31da8bf081092d9b72c3ddf6f174132e62485483 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 21 Jul 2026 14:15:00 +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 bcf91bf..36f05be 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -14,7 +14,8 @@ void log_message(LogLevel log_level, 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]);