diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-12-04 03:23:16 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-12-04 03:23:16 +0800 |
commit | 605eda115a7061488d2fb0e4264338598ea904d4 (patch) | |
tree | d89f84d2c14ff39140e063a3bbdd635ec58ac264 | |
parent | 34fa8474852c0efb0002dba6ad8daffbee1177d5 (diff) | |
download | gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar.gz gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar.bz2 gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar.lz gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar.xz gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.tar.zst gsoc2013-epiphany-605eda115a7061488d2fb0e4264338598ea904d4.zip |
Fix strftime(3) usage.
2003-12-03 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/GtkNSSDialogs.cpp:
* src/pdm-dialog.c: (show_cookies_properties):
Fix strftime(3) usage.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | embed/mozilla/GtkNSSDialogs.cpp | 7 | ||||
-rwxr-xr-x | src/pdm-dialog.c | 6 |
3 files changed, 17 insertions, 3 deletions
@@ -1,5 +1,12 @@ 2003-12-03 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/GtkNSSDialogs.cpp: + * src/pdm-dialog.c: (show_cookies_properties): + + Fix strftime(3) usage. + +2003-12-03 Christian Persch <chpe@cvs.gnome.org> + * src/pdm-dialog.c: (pdm_cmd_delete_selection), (compare_cookies): Fix two crashers. 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 ("\"<tt>%s</tt>\"", NS_ConvertUCS2toUTF8(commonName).get()); - secondary = g_strdup_printf (text, ttCommonName, formattedDate); + secondary = g_strdup_printf (text, ttCommonName, fdate); msg = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\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); diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index df1002f23..69c63b4ae 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -946,7 +946,11 @@ show_cookies_properties (PdmDialog *dialog, } else { - str = g_strdup_printf ("%s",ctime((time_t*)&info->expires)); + struct tm t; + char s[128]; + const char *fmt_hack = "%c"; + strftime (s, sizeof(s), fmt_hack, localtime_r (&info->expires, &t)); + str = g_locale_to_utf8 (s, -1, NULL, NULL, NULL); } label = gtk_label_new (str); g_free (str); |