From: Simon Josefsson Date: Tue, 23 Jun 2009 21:04:51 +0000 (+0200) Subject: Assume gmtime_r. X-Git-Tag: gnutls_2_9_2~61^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21a7186bf83084a2bc85bbb7ddb600ccd070f1c2;p=thirdparty%2Fgnutls.git Assume gmtime_r. --- diff --git a/lib/x509/common.c b/lib/x509/common.c index 51da7b1ac6..c8ea6958be 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -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 (>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; }