summaryrefslogtreecommitdiff
path: root/libtmdb
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-11-13 00:27:16 +0000
committerrandomdan <randomdan@localhost>2014-11-13 00:27:16 +0000
commite8cbe63d20fc21ffe643ac6a1febd41d8fb1e173 (patch)
treeca2ff875bcefaf5efb0a356de20f70c00b667725 /libtmdb
parentLink to external Boost UTF (diff)
downloadp2pvr-e8cbe63d20fc21ffe643ac6a1febd41d8fb1e173.tar.bz2
p2pvr-e8cbe63d20fc21ffe643ac6a1febd41d8fb1e173.tar.xz
p2pvr-e8cbe63d20fc21ffe643ac6a1febd41d8fb1e173.zip
Fix quirk (from glibc update?) around fields in struct tm and the _BSD_SOURCE macro
Diffstat (limited to 'libtmdb')
-rw-r--r--libtmdb/conversions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libtmdb/conversions.cpp b/libtmdb/conversions.cpp
index 488419f..6df323d 100644
--- a/libtmdb/conversions.cpp
+++ b/libtmdb/conversions.cpp
@@ -8,13 +8,13 @@ namespace Slicer {
std::string
dateToString(const ::TMDb::Date & in)
{
- char buf[BUFSIZ];
- struct tm tm({ 0, 0, 0, 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_mday = in.Day;
+ tm.tm_mon = in.Month;
+ tm.tm_year = in.Year;
mktime(&tm);
+ char buf[BUFSIZ];
auto len = strftime(buf, BUFSIZ, "%Y-%m-%d", &tm);
return std::string(buf, len);
}