]> git.sur5r.net Git - openldap/commitdiff
ITS#5035 - in St_read(), don't pass time_t* (st_data[i]->last) to lutil_atol().
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 1 Jul 2007 14:15:17 +0000 (14:15 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 1 Jul 2007 14:15:17 +0000 (14:15 +0000)
servers/slurpd/st.c

index c4d9dde80161829a0c9d66f67a6023bf4f4f2c48..88fab12889289d548a749078d6942b40fc865faf 100644 (file)
@@ -180,6 +180,7 @@ St_read(
     int                rc;
     char       *hostname, *port, *timestamp, *seq, *p, *t;
     int                found;
+    long       last;
 
     if ( st == NULL ) {
        return -1;
@@ -235,11 +236,11 @@ St_read(
            if ( !strcmp( hostname, sglob->st->st_data[ i ]->hostname ) &&
                    lutil_atoi( &p, port ) == 0 && p == sglob->st->st_data[ i ]->port )
            {
-               found = 1;
-               if ( lutil_atol( &sglob->st->st_data[ i ]->last, timestamp ) != 0
-                       || lutil_atoi( &sglob->st->st_data[ i ]->seq, seq ) != 0 )
-               {
-                   found = 0;
+               found = (lutil_atol( &last, timestamp ) == 0);
+               if ( found ) {
+                   sglob->st->st_data[i]->last = last;
+                   if ( lutil_atoi( &sglob->st->st_data[i]->seq, seq ) != 0 )
+                       found = 0;
                }
                break;
            }