diff --git a/src/main.c b/src/main.c index 77e3233..8850706 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "meta.h" #include "odt.h" #include "options.h" @@ -101,11 +102,13 @@ int main(int argc, char* argv[]) { xmlChar* doc; char templateFileName[FILENAME_MAX]; char timestamp[20]; - time_t tm; + time_t t; + struct tm ts; /* get timestamp */ - time(&tm); - strftime(timestamp, 20, "%Y-%m-%dT%H:%M:%S", localtime(&tm)); + time(&t); + localtime_r(&t, &ts); + strftime(timestamp, 20, "%Y-%m-%dT%H:%M:%S", &ts); xmlDocDumpMemoryEnc(transformed, &doc, &sz, "utf-8"); entry[0].path = "content.xml";