From: Thiago Santos Date: Tue, 27 Jul 2010 10:21:19 +0000 (-0300) Subject: gstdatetime: Fix localtime usage X-Git-Tag: RELEASE-0.10.31~267 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fda35f7ac7cc181e49ce147d3a8e01171b0b9a1e;p=platform%2Fupstream%2Fgstreamer.git gstdatetime: Fix localtime usage localtime only takes one parameter and returns a statically allocated tm struct. Use it correctly. Fixes #625368 --- diff --git a/gst/gstdatetime.c b/gst/gstdatetime.c index d68a397..85b3ff4 100644 --- a/gst/gstdatetime.c +++ b/gst/gstdatetime.c @@ -317,10 +317,11 @@ gst_date_time_new_from_unix_epoch (gint64 t) memset (&tm, 0, sizeof (tm)); tt = (time_t) t; + #ifdef HAVE_LOCALTIME_R localtime_r (&tt, &tm); #else - localtime (&tt, &tm); + memcpy (&tm, localtime (&tt), sizeof (struct tm)); #endif dt = gst_date_time_new (tm.tm_year + 1900,