From 4928887c760b0a6ef069891948bc2927097f7a5f Mon Sep 17 00:00:00 2001 From: Thomas Flueeli Date: Thu, 28 Oct 2010 12:26:15 +0200 Subject: [PATCH 4/5] replace localtime_r with g_time_val_to_iso8601 --- src/gabble.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gabble.c b/src/gabble.c index 382d4e3..903c906 100644 --- a/src/gabble.c +++ b/src/gabble.c @@ -77,18 +77,17 @@ log_handler (const gchar *log_domain, if (stamp_logs) { GTimeVal now; - gchar now_str[32]; + gchar *now_str = NULL; gchar *tmp; - struct tm tm; g_get_current_time (&now); - localtime_r (&(now.tv_sec), &tm); - strftime (now_str, 32, "%Y-%m-%d %H:%M:%S", &tm); + now_str = g_time_val_to_iso8601 (&now); tmp = g_strdup_printf ("%s.%06ld: %s", now_str, now.tv_usec, message); g_log_default_handler (log_domain, log_level, tmp, NULL); + g_free (now_str); g_free (tmp); } else -- 1.7.2.3