Skip to content

Commit

Permalink
fix WIN32 with localtime_s
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Feb 7, 2024
1 parent 73d7204 commit ccf4576
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fmt/text2pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ccf4576

Please sign in to comment.