From 69b612360e2e5e99d739dd9f40b6643e47db0d6d Mon Sep 17 00:00:00 2001 From: egecetin Date: Sat, 4 Jan 2025 11:29:22 +0300 Subject: [PATCH] fix const issue for win32 --- Packet++/src/NtpLayer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Packet++/src/NtpLayer.cpp b/Packet++/src/NtpLayer.cpp index 81e399a17..542bf53c3 100644 --- a/Packet++/src/NtpLayer.cpp +++ b/Packet++/src/NtpLayer.cpp @@ -600,9 +600,10 @@ namespace pcpp struct tm* timer = nullptr; time_t const timeStruct = integerPart; #if defined(_WIN32) - if (timeStruct < 0) - timeStruct = 0; - timer = gmtime(&timeStruct); + if (gmtime_s(&timer, &timeStruct)) + { + timer = nullptr; + } #else struct tm timer_r{}; timer = gmtime_r(&timeStruct, &timer_r);