#include <ac/string.h>
#include <ac/time.h>
+#include <lutil.h>
+
#include "slap.h"
#include "proto-slap.h"
#include "back-monitor.h"
struct monitorentrypriv *mp;
char buf[1024];
struct tm *tms;
- char tmbuf[20];
+ char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
/*
* Note: ltmbuf, ltm are used only if HACK_LOCAL_TIME is defined
local_time( tms, -timezone, tmbuf, sizeof( tmbuf ) );
#else /* !HACK_LOCAL_TIME */
tms = gmtime( &starttime );
- strftime( tmbuf, sizeof(tmbuf), "%Y%m%d%H%M%SZ", tms );
+ lutil_gentime( tmbuf, sizeof(tmbuf), tms );
#endif /* !HACK_LOCAL_TIME */
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
snprintf( buf, sizeof( buf ),
Entry *e
)
{
- char stmbuf[20], ctmbuf[20];
+ char stmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ],
+ ctmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
struct tm *stm, *ctm;
Attribute *a;
ber_len_t len;
local_time( stm, -timezone, stmbuf, sizeof( stmbuf ) );
#else /* !HACK_LOCAL_TIME */
stm = gmtime( &starttime );
- strftime( stmbuf, sizeof( stmbuf ), "%Y%m%d%H%M%SZ", stm );
+ lutil_gentime( stmbuf, sizeof( stmbuf ), stm );
#endif /* !HACK_LOCAL_TIME */
}
local_time( ctm, -timezone, ctmbuf, sizeof( ctmbuf ) );
#else /* !HACK_LOCAL_TIME */
ctm = gmtime( ¤tTime );
- strftime( ctmbuf, sizeof( ctmbuf ), "%Y%m%d%H%M%SZ", ctm );
+ lutil_gentime( ctmbuf, sizeof( ctmbuf ), ctm );
#endif /* !HACK_LOCAL_TIME */
}
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );