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 <libxml/tree.h>
#include <err.h>
#include <time.h>
#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";