]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/tmplout.c
Add reference to ldap.conf(5).
[openldap] / libraries / libldap / tmplout.c
index 372f427f25ea0c6a2a94d04ed25abf1a9a5c2e46..291ec3a785d5e83bec01c8b150d0d824c0fc4d76 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * tmplout.c:  display template library output routines for LDAP clients
  * 12 April 1994 by Mark C Smith
@@ -874,6 +878,7 @@ time2text( char *ldtimestr, int dateonly )
     struct tm          t;
     char               *p, *timestr, zone, *fmterr = "badly formatted time";
     time_t             gmttime;
+    char               timebuf[32];
 
     memset( (char *)&t, 0, sizeof( struct tm ));
     if ( (int) strlen( ldtimestr ) < 13 ) {
@@ -899,11 +904,12 @@ time2text( char *ldtimestr, int dateonly )
     }
 
     gmttime = gtime( &t );
-    timestr = ctime( &gmttime );
 
+    timestr = ldap_pvt_ctime( &gmttime, timebuf );
+   
     timestr[ strlen( timestr ) - 1 ] = zone;   /* replace trailing newline */
     if ( dateonly ) {
-       strcpy( timestr + 11, timestr + 20 );
+       SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 );
     }
 
     return( timestr );