glib r7840 - in trunk: . glib



Author: matthiasc
Date: Sat Jan 31 19:19:21 2009
New Revision: 7840
URL: http://svn.gnome.org/viewvc/glib?rev=7840&view=rev

Log:
i        * glib/gtimer.c (g_time_val_to_iso8601): Pass a time_t* to gmtime().
        Pointed out by Matthias Drochner.



Modified:
   trunk/ChangeLog
   trunk/glib/gtimer.c

Modified: trunk/glib/gtimer.c
==============================================================================
--- trunk/glib/gtimer.c	(original)
+++ trunk/glib/gtimer.c	Sat Jan 31 19:19:21 2009
@@ -419,19 +419,18 @@
 #ifdef HAVE_GMTIME_R
   struct tm tm_;
 #endif
+  time_t secs;
   
   g_return_val_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC, NULL);
 
+ secs = time_->tv_sec;
 #ifdef _WIN32
-  {
-    time_t secs = time_->tv_sec;
-    tm = gmtime (&secs);
-  }
+ tm = gmtime (&secs);
 #else
 #ifdef HAVE_GMTIME_R
-  tm = gmtime_r (&time_->tv_sec, &tm_);
+  tm = gmtime_r (&secs, &tm_);
 #else
-  tm = gmtime (&time_->tv_sec);
+  tm = gmtime (&secs);
 #endif
 #endif
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]