]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Assume gmtime_r.
authorSimon Josefsson <simon@josefsson.org>
Tue, 23 Jun 2009 21:04:51 +0000 (23:04 +0200)
committerSimon Josefsson <simon@josefsson.org>
Tue, 23 Jun 2009 21:04:51 +0000 (23:04 +0200)
lib/x509/common.c

index 51da7b1ac64b917675ba5124cc9f43381173cb0e..c8ea6958be42962f0b2e5906e144c729330762f5 100644 (file)
@@ -530,27 +530,22 @@ static int
 _gnutls_x509_gtime2utcTime (time_t gtime, char *str_time, int str_time_size)
 {
   size_t ret;
-
-#ifdef HAVE_GMTIME_R
   struct tm _tm;
 
-  gmtime_r (&gtime, &_tm);
+  if (!gmtime_r (&gtime, &_tm))
+    {
+      gnutls_assert ();
+      return GNUTLS_E_INTERNAL_ERROR;
+    }
 
   ret = strftime (str_time, str_time_size, "%y%m%d%H%M%SZ", &_tm);
-#else
-  struct tm *_tm;
-
-  _tm = gmtime (&gtime);
-
-  ret = strftime (str_time, str_time_size, "%y%m%d%H%M%SZ", _tm);
-#endif
-
   if (!ret)
     {
       gnutls_assert ();
       return GNUTLS_E_SHORT_MEMORY_BUFFER;
     }
 
+
   return 0;
 
 }