_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 (>ime, &_tm);
+ if (!gmtime_r (>ime, &_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 (>ime);
-
- 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;
}