]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#4505
authorHoward Chu <hyc@openldap.org>
Wed, 26 Apr 2006 09:12:40 +0000 (09:12 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 26 Apr 2006 09:12:40 +0000 (09:12 +0000)
servers/slapd/overlays/accesslog.c

index ebae343bed146d4bbb972bffe13b2a121a63f447..b9b3f4df442604c7953cbecb3abd928bf8c9c641 100644 (file)
@@ -396,12 +396,16 @@ log_age_parse(char *agestr)
                        return -1;
                t1 *= 24;
                gotdays = 1;
-       } else if ( *endptr != ':' ) {
-       /* No valid delimiter found, fail */
-               return -1;
+               agestr = endptr + 1;
+       } else {
+               if ( agestr[2] != ':' ) {
+                       /* No valid delimiter found, fail */
+                       return -1;
+               }
+               t1 *= 60;
+               agestr += 3;
        }
 
-       agestr = endptr + 1;
        t2 = atoi( agestr );
 
        /* if there's a delimiter, it can only be a colon */
@@ -414,7 +418,6 @@ log_age_parse(char *agestr)
        if ( gotdays && !agestr[2] )
                return -1;
 
-       t1 *= 60;
        t1 += t2;
 
        if ( !agestr[2] )
@@ -449,7 +452,7 @@ log_age_unparse( int age, struct berval *agebv )
        age /= 60;
        mm = age % 60;
        age /= 60;
-       hh = age % 60;
+       hh = age % 24;
        age /= 24;
        dd = age;