From: Howard Chu Date: Wed, 26 Apr 2006 10:26:46 +0000 (+0000) Subject: Fix prev commit X-Git-Tag: OPENLDAP_REL_ENG_2_4_1ALPHA~2^2~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bac546adb0d02a4df405a35751c2066e5fe0e339;p=openldap Fix prev commit --- diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index b9b3f4df44..3600b3591d 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -407,21 +407,18 @@ log_age_parse(char *agestr) } t2 = atoi( agestr ); - - /* if there's a delimiter, it can only be a colon */ - if ( agestr[2] && agestr[2] != ':' ) - return -1; - - /* If we're at the end of the string, and we started with days, - * fail because we expected to find minutes too. - */ - if ( gotdays && !agestr[2] ) - return -1; - t1 += t2; - if ( !agestr[2] ) - return t1 * 60; + if ( agestr[2] ) { + /* if there's a delimiter, it can only be a colon */ + if ( agestr[2] != ':' ) + return -1; + } else { + /* If we're at the end of the string, and we started with days, + * fail because we expected to find minutes too. + */ + return gotdays ? -1 : t1 * 60; + } agestr += 3; t2 = atoi( agestr ); @@ -432,11 +429,11 @@ log_age_parse(char *agestr) t1 *= 60; t1 += t2; - t1 *= 60; if ( agestr[2] ) { agestr += 3; if ( agestr[2] ) return -1; + t1 *= 60; t1 += atoi( agestr ); } return t1;