From: Nikos Mavrogiannopoulos Date: Sat, 24 May 2008 11:24:02 +0000 (+0300) Subject: Print Never when a certificate never expires. X-Git-Tag: gnutls_2_3_12~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f01870e2dfd6b436f8488b0d9c27840dcea096f8;p=thirdparty%2Fgnutls.git Print Never when a certificate never expires. --- diff --git a/lib/openpgp/output.c b/lib/openpgp/output.c index 4336a3cff9..a499a6fa51 100644 --- a/lib/openpgp/output.c +++ b/lib/openpgp/output.c @@ -201,12 +201,19 @@ print_key_times(gnutls_string * str, gnutls_openpgp_crt_t cert, int idx) size_t max = sizeof (s); struct tm t; - if (gmtime_r (&tim, &t) == NULL) - addf (str, "error: gmtime_r (%d)\n", t); - else if (strftime (s, max, "%a %b %e %H:%M:%S UTC %Y", &t) == 0) - addf (str, "error: strftime (%d)\n", t); + if (tim == 0) + { + addf (str, _("\t\tExpiration: Never\n"), s); + } else - addf (str, _("\t\tExpiration: %s\n"), s); + { + if (gmtime_r (&tim, &t) == NULL) + addf (str, "error: gmtime_r (%d)\n", t); + else if (strftime (s, max, "%a %b %e %H:%M:%S UTC %Y", &t) == 0) + addf (str, "error: strftime (%d)\n", t); + else + addf (str, _("\t\tExpiration: %s\n"), s); + } } }