]> git.sur5r.net Git - openldap/commitdiff
fix previous commit
authorPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 00:12:39 +0000 (00:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 00:12:39 +0000 (00:12 +0000)
libraries/libldap/util-int.c

index 062c892fba32e0f3c3f5b2f265fb4c3df7d650f2..d07ce1865e3054155fc88afc98c1d8e8ad6aea65 100644 (file)
@@ -147,7 +147,10 @@ ldap_pvt_gmtime( const time_t *timep, struct tm *result )
 # endif /* LDAP_R_COMPILE */
 
        tm_ptr = gmtime( timep );
-       if ( tm_ptr != NULL ) {
+       if ( tm_ptr == NULL ) {
+               result = NULL;
+
+       } else {
                *result = *tm_ptr;
        }
 
@@ -155,7 +158,7 @@ ldap_pvt_gmtime( const time_t *timep, struct tm *result )
        ldap_pvt_thread_mutex_unlock( &ldap_int_gmtime_mutex );
 # endif /* LDAP_R_COMPILE */
 
-       return tm_ptr;
+       return result;
 }
 #endif /* !USE_GMTIME_R */
 
@@ -170,7 +173,10 @@ ldap_pvt_localtime( const time_t *timep, struct tm *result )
 # endif /* LDAP_R_COMPILE */
 
        tm_ptr = localtime( timep );
-       if ( tm_ptr != NULL ) {
+       if ( tm_ptr == NULL ) {
+               result = NULL;
+
+       } else {
                *result = *tm_ptr;
        }
 
@@ -178,7 +184,7 @@ ldap_pvt_localtime( const time_t *timep, struct tm *result )
        ldap_pvt_thread_mutex_unlock( &ldap_int_gmtime_mutex );
 # endif /* LDAP_R_COMPILE */
 
-       return tm_ptr;
+       return result;
 }
 #endif /* !USE_LOCALTIME_R */