From 605eda115a7061488d2fb0e4264338598ea904d4 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 3 Dec 2003 19:23:16 +0000 Subject: Fix strftime(3) usage. 2003-12-03 Christian Persch * embed/mozilla/GtkNSSDialogs.cpp: * src/pdm-dialog.c: (show_cookies_properties): Fix strftime(3) usage. --- embed/mozilla/GtkNSSDialogs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'embed/mozilla/GtkNSSDialogs.cpp') diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp index 410293e52..94d8e9527 100644 --- a/embed/mozilla/GtkNSSDialogs.cpp +++ b/embed/mozilla/GtkNSSDialogs.cpp @@ -391,7 +391,8 @@ GtkNSSDialogs::ConfirmCertExpired (nsIInterfaceRequestor *ctx, nsAutoString commonName; time_t t; struct tm tm; - char formattedDate[32]; + char formattedDate[128]; + char *fdate; const char *primary, *text; char *ttCommonName, *secondary, *msg; @@ -430,11 +431,12 @@ GtkNSSDialogs::ConfirmCertExpired (nsIInterfaceRequestor *ctx, * strftime(3) */ strftime (formattedDate, sizeof(formattedDate), _("%a %d %b %Y"), localtime_r (&t, &tm)); + fdate = g_locale_to_utf8 (formattedDate, -1, NULL, NULL, NULL); ttCommonName = g_strdup_printf ("\"%s\"", NS_ConvertUCS2toUTF8(commonName).get()); - secondary = g_strdup_printf (text, ttCommonName, formattedDate); + secondary = g_strdup_printf (text, ttCommonName, fdate); msg = g_strdup_printf ("%s\n\n%s\n\n%s", primary, secondary, @@ -442,6 +444,7 @@ GtkNSSDialogs::ConfirmCertExpired (nsIInterfaceRequestor *ctx, int res = display_cert_warning_box (ctx, cert, msg, NULL, NULL, NULL); + g_free (fdate); g_free (msg); g_free (secondary); g_free (ttCommonName); -- cgit