mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 11:39:34 -05:00
cleanup previous commit; update header
This commit is contained in:
parent
a004061c0a
commit
0b5691f122
2 changed files with 10 additions and 10 deletions
|
|
@ -149,8 +149,10 @@ struct tm;
|
|||
|
||||
/* use this macro to statically allocate buffer for lutil_gentime */
|
||||
#define LDAP_LUTIL_GENTIME_BUFSIZE 22
|
||||
#define lutil_gentime(s,m,t) lutil_localtime((s),(m),(t),0)
|
||||
LDAP_LUTIL_F( size_t )
|
||||
lutil_gentime LDAP_P(( char *s, size_t max, const struct tm *tm ));
|
||||
lutil_localtime LDAP_P(( char *s, size_t smax, const struct tm *tm,
|
||||
long delta ));
|
||||
|
||||
#ifndef HAVE_MKSTEMP
|
||||
LDAP_LUTIL_F( int )
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ char* lutil_progname( const char* name, int argc, char *argv[] )
|
|||
return progname;
|
||||
}
|
||||
|
||||
#if 0
|
||||
size_t lutil_gentime( char *s, size_t smax, const struct tm *tm )
|
||||
{
|
||||
#if 0
|
||||
size_t ret;
|
||||
#ifdef HAVE_EBCDIC
|
||||
/* We've been compiling in ASCII so far, but we want EBCDIC now since
|
||||
|
|
@ -62,18 +62,16 @@ size_t lutil_gentime( char *s, size_t smax, const struct tm *tm )
|
|||
__etoa( s );
|
||||
#endif
|
||||
return ret;
|
||||
#else
|
||||
return lutil_localtime( s, smax, tm, 0 );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
size_t lutil_localtime( char *s, size_t smax, const struct tm *tm, long delta )
|
||||
{
|
||||
size_t ret;
|
||||
char *p;
|
||||
|
||||
if ( smax < 20 ) {
|
||||
return -1;
|
||||
if ( smax < 16 ) { /* YYYYmmddHHMMSSZ */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_EBCDIC
|
||||
|
|
@ -83,12 +81,12 @@ size_t lutil_localtime( char *s, size_t smax, const struct tm *tm, long delta )
|
|||
#pragma convlit(suspend)
|
||||
#endif
|
||||
ret = strftime( s, smax, "%Y%m%d%H%M%SZ", tm );
|
||||
if ( ret == 0 ) {
|
||||
if ( delta == 0 || ret == 0 ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ( delta == 0 ) {
|
||||
return ret;
|
||||
if ( smax < 20 ) { /* YYYYmmddHHMMSS+HHMM */
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = s + 14;
|
||||
|
|
|
|||
Loading…
Reference in a new issue