From ccf45763f1eaba2ff87b1829af2104a0007b9488 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Wed, 7 Feb 2024 12:35:55 +0100 Subject: [PATCH] fix WIN32 with localtime_s --- src/fmt/text2pcap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fmt/text2pcap.c b/src/fmt/text2pcap.c index c009e4656..bd135a2f3 100644 --- a/src/fmt/text2pcap.c +++ b/src/fmt/text2pcap.c @@ -22,7 +22,11 @@ int re_text2pcap(struct re_printf *pf, struct re_text2pcap *pcap) if (!buf) return EINVAL; +#ifdef WIN32 + localtime_s(&tm, &t); +#else localtime_r(&t, &tm); +#endif gettimeofday(&tv, NULL); strftime(ts, sizeof(ts), "%H:%M:%S", &tm);