diff options
-rw-r--r-- | Jamroot.jam | 2 | ||||
-rw-r--r-- | slicer/test/conversions.cpp | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Jamroot.jam b/Jamroot.jam index e02a59a..396dfd0 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -11,4 +11,4 @@ project ; -alias all : project2 netfs ytfs ; +alias all : project2 netfs libjsonpp p2pvr libtmdb slicer ; diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp index a6c2c06..552135c 100644 --- a/slicer/test/conversions.cpp +++ b/slicer/test/conversions.cpp @@ -19,13 +19,16 @@ namespace Slicer { std::string dateTimeToString(const ::TestModule::DateTime & in) { - char buf[BUFSIZ]; - struct tm tm({ in.second, in.minute, in.hour, in.day, in.month, in.year, 0, 0, 0 -#ifdef _BSD_SOURCE - , 0, 0 -#endif - }); + struct tm tm; + memset(&tm, 0, sizeof(struct tm)); + tm.tm_sec = in.second; + tm.tm_min = in.minute; + tm.tm_hour = in.hour; + tm.tm_mday = in.day; + tm.tm_mon = in.month; + tm.tm_year = in.year; mktime(&tm); + char buf[BUFSIZ]; auto len = strftime(buf, BUFSIZ, "%Y-%b-%d %H:%M:%S", &tm); return std::string(buf, len); } |