summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2020-08-24 18:59:05 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2020-08-24 18:59:05 +0200
commit73d49dbde93650c3ce08974c83142de0b87e229c (patch)
treed75b713c7bf3a10c6fa39d01e4590c58e1c11e68
parent28462586703df7507411b285174cd59b279bbd8d (diff)
src/dfxml.c: fix xml_add_DFXML_creator() for mingw32
-rw-r--r--src/dfxml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dfxml.c b/src/dfxml.c
index 947436e..93b8db1 100644
--- a/src/dfxml.c
+++ b/src/dfxml.c
@@ -250,8 +250,12 @@ void xml_add_DFXML_creator(const char *package, const char *version)
{
char outstr[200];
const time_t t = time(NULL);
+#if defined(__MINGW32__) || defined(__FRAMAC__)
+ const struct tm *tmptr = localtime(&t);
+#else
struct tm tm_tmp;
const struct tm *tmp = localtime_r(&t,&tm_tmp);
+#endif
if (tmp != NULL &&
strftime(outstr, sizeof(outstr), "%Y-%m-%dT%H:%M:%S%z", tmp) != 0)
{