Skip to content

Commit

Permalink
fix const issue for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
egecetin committed Jan 4, 2025
1 parent 90cf3f0 commit 69b6123
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Packet++/src/NtpLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 69b6123

Please sign in to comment.