X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fst.c;h=5b31dfb8d5a00f0c1ddda806050ac67c875a3786;hb=d84ffb62a6c7528ef711547194307af629e0d082;hp=cb78c2d9c90b4a7d3cce6d8d687c242995befab7;hpb=dc0eacd40b625258355eea866d62188e5aa7ce3b;p=openldap diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index cb78c2d9c9..5b31dfb8d5 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -43,6 +43,7 @@ #include "slurp.h" #include "globals.h" +#include "lutil.h" /* * Add information about replica host specified by Ri to list @@ -230,11 +231,16 @@ St_read( found = 0; for ( i = 0; i < sglob->st->st_nreplicas; i++ ) { + int p; if ( !strcmp( hostname, sglob->st->st_data[ i ]->hostname ) && - atoi( port ) == sglob->st->st_data[ i ]->port ) { + lutil_atoi( &p, port ) == 0 && p == sglob->st->st_data[ i ]->port ) + { found = 1; - sglob->st->st_data[ i ]->last = atol( timestamp ); - sglob->st->st_data[ i ]->seq = atoi( seq ); + if ( lutil_atol( &sglob->st->st_data[ i ]->last, timestamp ) != 0 + || lutil_atoi( &sglob->st->st_data[ i ]->seq, seq ) != 0 ) + { + found = 0; + } break; } }