]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Print Never when a certificate never expires.
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>
Sat, 24 May 2008 11:24:02 +0000 (14:24 +0300)
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>
Sat, 24 May 2008 11:24:02 +0000 (14:24 +0300)
lib/openpgp/output.c

index 4336a3cff9ef46bb476a5d91bd0b5f2ed29f7d71..a499a6fa51b2e542af8e396bdc17ef416e264edd 100644 (file)
@@ -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);
+       }
     }
 }