Portability fix

This commit is contained in:
David Baer
2016-06-30 15:26:45 -04:00
parent de2fade0a7
commit 6b872051b4

View File

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