]> git.sur5r.net Git - openldap/commitdiff
Warning cleanup: signed meets unsigned.
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 Nov 2008 18:39:15 +0000 (18:39 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 Nov 2008 18:39:15 +0000 (18:39 +0000)
16 files changed:
clients/tools/ldapmodify.c
clients/tools/ldapsearch.c
libraries/libldap/abandon.c
libraries/libldap/cyrus.c
libraries/libldap/result.c
servers/slapd/back-bdb/attr.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/config.c
servers/slapd/back-ldap/monitor.c
servers/slapd/bconfig.c
servers/slapd/overlays/accesslog.c
servers/slapd/overlays/pcache.c
servers/slapd/overlays/syncprov.c
servers/slapd/overlays/translucent.c
servers/slapd/sasl.c

index 558cdb6bbf98219423e0784701904d886170d906..9fef596368a5adbe7db9c1405651462735dfbb91 100644 (file)
@@ -95,8 +95,8 @@ static struct berval BV_NEWRDN = BER_BVC("newrdn");
 static struct berval BV_DELETEOLDRDN = BER_BVC("deleteoldrdn");
 static struct berval BV_NEWSUP = BER_BVC("newsuperior");
 
-#define        BVICMP(a,b)     ((a)->bv_len != (b)->bv_len ? \
-       (a)->bv_len - (b)->bv_len : strcasecmp((a)->bv_val, (b)->bv_val))
+#define        BV_CASEMATCH(a, b) \
+       ((a)->bv_len == (b)->bv_len && 0 == strcasecmp((a)->bv_val, (b)->bv_val))
 
 static int process_ldif_rec LDAP_P(( char *rbuf, int lineno ));
 static int parse_ldif_control LDAP_P(( struct berval *val, LDAPControl ***pctrls ));
@@ -457,7 +457,7 @@ process_ldif_rec( char *rbuf, int linenum )
                freeval[i] = freev;
 
                if ( dn == NULL ) {
-                       if ( linenum+i == 1 && !BVICMP( btype+i, &BV_VERSION )) {
+                       if ( linenum+i == 1 && BV_CASEMATCH( btype+i, &BV_VERSION )) {
                                int     v;
                                if( vals[i].bv_len == 0 || lutil_atoi( &v, vals[i].bv_val) != 0 || v != 1 ) {
                                        fprintf( stderr,
@@ -466,7 +466,7 @@ process_ldif_rec( char *rbuf, int linenum )
                                }
                                version++;
 
-                       } else if ( !BVICMP( btype+i, &BV_DN )) {
+                       } else if ( BV_CASEMATCH( btype+i, &BV_DN )) {
                                dn = vals[i].bv_val;
                                idn = i;
                        }
@@ -494,7 +494,7 @@ process_ldif_rec( char *rbuf, int linenum )
 
        i = idn+1;
        /* Check for "control" tag after dn and before changetype. */
-       if (!BVICMP( btype+i, &BV_CONTROL)) {
+       if ( BV_CASEMATCH( btype+i, &BV_CONTROL )) {
                /* Parse and add it to the list of controls */
                rc = parse_ldif_control( vals+i, &pctrls );
                if (rc != 0) {
@@ -515,7 +515,7 @@ short_input:
        }
 
        /* Check for changetype */
-       if ( !BVICMP( btype+i, &BV_CHANGETYPE )) {
+       if ( BV_CASEMATCH( btype+i, &BV_CHANGETYPE )) {
 #ifdef LIBERAL_CHANGETYPE_MODOP
                /* trim trailing spaces (and log warning ...) */
                int icnt;
@@ -533,20 +533,20 @@ short_input:
                }
 #endif /* LIBERAL_CHANGETYPE_MODOP */
 
-               if ( BVICMP( vals+i, &BV_MODIFYCT ) == 0 ) {
+               if ( BV_CASEMATCH( vals+i, &BV_MODIFYCT )) {
                        new_entry = 0;
                        expect_modop = 1;
-               } else if ( BVICMP( vals+i, &BV_ADDCT ) == 0 ) {
+               } else if ( BV_CASEMATCH( vals+i, &BV_ADDCT )) {
                        new_entry = 1;
                        modop = LDAP_MOD_ADD;
-               } else if ( BVICMP( vals+i, &BV_MODRDNCT ) == 0
-                       || BVICMP( vals+i, &BV_MODDNCT ) == 0
-                       || BVICMP( vals+i, &BV_RENAMECT ) == 0)
+               } else if ( BV_CASEMATCH( vals+i, &BV_MODRDNCT )
+                       || BV_CASEMATCH( vals+i, &BV_MODDNCT )
+                       || BV_CASEMATCH( vals+i, &BV_RENAMECT ))
                {
                        i++;
                        if ( i >= lines )
                                goto short_input;
-                       if ( BVICMP( btype+i, &BV_NEWRDN )) {
+                       if ( !BV_CASEMATCH( btype+i, &BV_NEWRDN )) {
                                fprintf( stderr, _("%s: expecting \"%s:\" but saw"
                                        " \"%s:\" (line %d, entry \"%s\")\n"),
                                        prog, BV_NEWRDN.bv_val, btype[i].bv_val, linenum+i, dn );
@@ -557,7 +557,7 @@ short_input:
                        i++;
                        if ( i >= lines )
                                goto short_input;
-                       if ( BVICMP( btype+i, &BV_DELETEOLDRDN )) {
+                       if ( !BV_CASEMATCH( btype+i, &BV_DELETEOLDRDN )) {
                                fprintf( stderr, _("%s: expecting \"%s:\" but saw"
                                        " \"%s:\" (line %d, entry \"%s\")\n"),
                                        prog, BV_DELETEOLDRDN.bv_val, btype[i].bv_val, linenum+i, dn );
@@ -567,7 +567,7 @@ short_input:
                        deleteoldrdn = ( vals[i].bv_val[0] == '0' ) ? 0 : 1;
                        i++;
                        if ( i < lines ) {
-                               if ( BVICMP( btype+i, &BV_NEWSUP )) {
+                               if ( !BV_CASEMATCH( btype+i, &BV_NEWSUP )) {
                                        fprintf( stderr, _("%s: expecting \"%s:\" but saw"
                                                " \"%s:\" (line %d, entry \"%s\")\n"),
                                                prog, BV_NEWSUP.bv_val, btype[i].bv_val, linenum+i, dn );
@@ -578,7 +578,7 @@ short_input:
                                i++;
                        }
                        got_all = 1;
-               } else if ( BVICMP( vals+i, &BV_DELETECT ) == 0 ) {
+               } else if ( BV_CASEMATCH( vals+i, &BV_DELETECT )) {
                        got_all = delete_entry = 1;
                } else {
                        fprintf( stderr,
@@ -615,7 +615,7 @@ short_input:
                /* Make sure all attributes with multiple values are contiguous */
                for (; i<lines; i++) {
                        for (j=i+1; j<lines; j++) {
-                               if ( !BVICMP( btype+i, btype+j )) {
+                               if ( BV_CASEMATCH( btype+i, btype+j )) {
                                        nmods--;
                                        /* out of order, move intervening attributes down */
                                        if ( j != i+1 ) {
@@ -649,13 +649,13 @@ short_input:
                k = -1;
                BER_BVZERO(&bv);
                for (i=idn; i<lines; i++) {
-                       if ( !BVICMP( btype+i, &BV_DN )) {
+                       if ( BV_CASEMATCH( btype+i, &BV_DN )) {
                                fprintf( stderr, _("%s: attributeDescription \"%s\":"
                                        " (possible missing newline"
                                                " after line %d, entry \"%s\"?)\n"),
                                        prog, btype[i].bv_val, linenum+i - 1, dn );
                        }
-                       if ( BVICMP(btype+i,&bv)) {
+                       if ( !BV_CASEMATCH( btype+i, &bv )) {
                                bvl[k++] = NULL;
                                bv = btype[i];
                                lm[j].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES;
@@ -694,11 +694,11 @@ short_input:
 
                        expect_modop = 0;
                        expect_sep = 1;
-                       if ( BVICMP( btype+i, &BV_MODOPADD ) == 0 ) {
+                       if ( BV_CASEMATCH( btype+i, &BV_MODOPADD )) {
                                modop = LDAP_MOD_ADD;
                                mops[i] = M_SEP;
                                nmods--;
-                       } else if ( BVICMP( btype+i, &BV_MODOPREPLACE ) == 0 ) {
+                       } else if ( BV_CASEMATCH( btype+i, &BV_MODOPREPLACE )) {
                        /* defer handling these since they might have no values.
                         * Use the BVALUES flag to signal that these were
                         * deferred. If values are provided later, this
@@ -707,11 +707,11 @@ short_input:
                                modop = LDAP_MOD_REPLACE;
                                mops[i] = modop | LDAP_MOD_BVALUES;
                                btype[i] = vals[i];
-                       } else if ( BVICMP( btype+i, &BV_MODOPDELETE ) == 0 ) {
+                       } else if ( BV_CASEMATCH( btype+i, &BV_MODOPDELETE )) {
                                modop = LDAP_MOD_DELETE;
                                mops[i] = modop | LDAP_MOD_BVALUES;
                                btype[i] = vals[i];
-                       } else if ( BVICMP( btype+i, &BV_MODOPINCREMENT ) == 0 ) {
+                       } else if ( BV_CASEMATCH( btype+i, &BV_MODOPINCREMENT )) {
                                modop = LDAP_MOD_INCREMENT;
                                mops[i] = M_SEP;
                                nmods--;
@@ -729,7 +729,7 @@ short_input:
                        expect_modop = 1;
                        nmods--;
                } else {
-                       if ( BVICMP( btype+i, &bv )) {
+                       if ( !BV_CASEMATCH( btype+i, &bv )) {
                                fprintf( stderr, _("%s: wrong attributeType at"
                                        " line %d, entry \"%s\"\n"),
                                        prog, linenum+i, dn );
@@ -740,8 +740,9 @@ short_input:
                        /* If prev op was deferred and matches this type,
                         * clear the flag
                         */
-                       if ( (mops[i-1]&LDAP_MOD_BVALUES) && !BVICMP(btype+i,
-                               btype+i-1)) {
+                       if ( (mops[i-1] & LDAP_MOD_BVALUES)
+                               && BV_CASEMATCH( btype+i, btype+i-1 ))
+                       {
                                mops[i-1] = M_SEP;
                                nmods--;
                        }
@@ -756,7 +757,7 @@ short_input:
                for (j=i+1; j<lines; j++) {
                        if ( mops[j] == M_SEP || mops[i] != mops[j] )
                                continue;
-                       if ( !BVICMP( btype+i, btype+j )) {
+                       if ( BV_CASEMATCH( btype+i, btype+j )) {
                                nmods--;
                                /* out of order, move intervening attributes down */
                                if ( j != i+1 ) {
@@ -802,7 +803,7 @@ short_input:
        for (i=idn; i<lines; i++) {
                if ( mops[i] == M_SEP )
                        continue;
-               if ( mops[i] != mops[i-1] || BVICMP(btype+i,&bv)) {
+               if ( mops[i] != mops[i-1] || !BV_CASEMATCH( btype+i, &bv )) {
                        bvl[k++] = NULL;
                        bv = btype[i];
                        lm[j].mod_op = mops[i] | LDAP_MOD_BVALUES;
index 04bbc725b04d2c2c609e22459489cc67068f2b77..7e69fa5992b174a4aa56ff8274137afd4df8e71c 100644 (file)
@@ -1146,14 +1146,15 @@ static int dosearch(
        int                     cancel_msgid = -1;
 
        if( filtpatt != NULL ) {
-               size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1;
+               size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1, outlen;
                filter = malloc( max_fsize );
                if( filter == NULL ) {
                        perror( "malloc" );
                        return EXIT_FAILURE;
                }
 
-               if( snprintf( filter, max_fsize, filtpatt, value ) >= max_fsize ) {
+               outlen = snprintf( filter, max_fsize, filtpatt, value );
+               if( outlen >= max_fsize ) {
                        fprintf( stderr, "Bad filter pattern: \"%s\"\n", filtpatt );
                        free( filter );
                        return EXIT_FAILURE;
index bd9ebb38181a3e0907d90c6d11de6b9bce924725..3983a8e12314755c21c3b8a8d6182456b1f7b96f 100644 (file)
@@ -412,7 +412,7 @@ ldap_int_bisect_insert( ber_int_t **vp, ber_len_t *np, int id, int idx )
        assert( np != NULL );
        assert( *np >= 0 );
        assert( idx >= 0 );
-       assert( idx <= *np );
+       assert( (unsigned) idx <= *np );
 
        n = *np;
 
@@ -453,7 +453,7 @@ ldap_int_bisect_delete( ber_int_t **vp, ber_len_t *np, int id, int idx )
        assert( np != NULL );
        assert( *np >= 0 );
        assert( idx >= 0 );
-       assert( idx < *np );
+       assert( (unsigned) idx < *np );
 
        v = *vp;
 
index 0aee1c8a68a90debe190870336b5dc7b70b8e333..aad8f8ed8843a34ff4e9cadbdc7430c0d8f660d9 100644 (file)
@@ -162,7 +162,7 @@ sb_sasl_cyrus_encode(
        ber_int_t ret;
        unsigned tmpsize = dst->buf_size;
 
-       ret = sasl_encode( sasl_context, buf, len,
+       ret = sasl_encode( sasl_context, (char *)buf, len,
                           (SASL_CONST char **)&dst->buf_base,
                           &tmpsize );
 
@@ -556,7 +556,7 @@ ldap_int_sasl_bind(
                                /* and server provided us with data? */
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
-                                       rc, saslrc, scred ? scred->bv_len : -1 );
+                                       rc, saslrc, scred ? (long) scred->bv_len : -1L );
                                ber_bvfree( scred );
                                scred = NULL;
                        }
@@ -840,7 +840,7 @@ int ldap_pvt_sasl_secprops(
        const char *in,
        sasl_security_properties_t *secprops )
 {
-       int i, j, l;
+       unsigned i, j, l;
        char **props;
        unsigned sflags = 0;
        int got_sflags = 0;
index 07c3f5be7c489d93bb88b160a8b75c693ee784e9..fccee3d14cf1039a6a59b4d1777c91fa75865994 100644 (file)
@@ -1435,7 +1435,7 @@ ldap_mark_abandoned( LDAP *ld, ber_int_t msgid, int idx )
 
        /* NOTE: those assertions are repeated in ldap_int_bisect_delete() */
        assert( idx >= 0 );
-       assert( idx < ld->ld_nabandoned );
+       assert( (unsigned) idx < ld->ld_nabandoned );
        assert( ld->ld_abandoned[ idx ] == msgid );
 
        return ldap_int_bisect_delete( &ld->ld_abandoned, &ld->ld_nabandoned,
index dd9d06f2db6c2cf9290452504fcb982e1b934c96..0ccbc0e8625bb94a99c61e79aacfc4b2177f2c57 100644 (file)
  * set point for insertion if ins is non-NULL
  */
 int
-bdb_attr_slot( struct bdb_info *bdb, AttributeDescription *ad, unsigned *ins )
+bdb_attr_slot( struct bdb_info *bdb, AttributeDescription *ad, int *ins )
 {
        unsigned base = 0, cursor = 0;
        unsigned n = bdb->bi_nattrs;
        int val = 0;
        
        while ( 0 < n ) {
-               int pivot = n >> 1;
+               unsigned pivot = n >> 1;
                cursor = base + pivot;
 
                val = SLAP_PTRCMP( ad, bdb->bi_attrs[cursor]->ai_desc );
@@ -61,7 +61,7 @@ bdb_attr_slot( struct bdb_info *bdb, AttributeDescription *ad, unsigned *ins )
 static int
 ainfo_insert( struct bdb_info *bdb, AttrInfo *a )
 {
-       unsigned x;
+       int x;
        int i = bdb_attr_slot( bdb, a->ai_desc, &x );
 
        /* Is it a dup? */
index 0659c6b1e261ecc8a56e59712e0a4316aa202131..f255334675bb5c619f1e0245f9f1c51d83ad69d5 100644 (file)
@@ -45,7 +45,7 @@ AttrInfo *bdb_attr_mask( struct bdb_info *bdb,
 void bdb_attr_flush( struct bdb_info *bdb );
 
 int bdb_attr_slot( struct bdb_info *bdb,
-       AttributeDescription *desc, unsigned *insert );
+       AttributeDescription *desc, int *insert );
 
 int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
        const char *fname, int lineno,
index a5ac722314e201cf4e23bee0622054e807116965..aa2d87983cef14f9786a8ef86e1e07d8fe553f8b 100644 (file)
@@ -2613,7 +2613,7 @@ ldap_back_controls_add(
                goto done;
        }
 
-       assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
+       assert( j1 + j2 <= (int) (sizeof( c )/sizeof( c[0] )) );
 
        if ( op->o_ctrls ) {
                for ( n = 0; op->o_ctrls[ n ]; n++ )
index ca89cf97f082a46f48b48f01f1148c2bb5a05384..d95f6815b9e3564744bf21bc5e42c82709dbc803 100644 (file)
@@ -520,7 +520,7 @@ slap_retry_info_unparse(
 
        BER_BVZERO( bvout );
 
-#define WHATSLEFT      ( sizeof( buf ) - ( ptr - buf ) )
+#define WHATSLEFT      ( &buf[ sizeof( buf ) ] - ptr )
 
        for ( i = 0; ri->ri_num[ i ] != SLAP_RETRYNUM_TAIL; i++ ) {
                if ( i > 0 ) {
index 8fcb597e589845ecb345a42b76cde967ca164636..73be42d9a052d50c51124d0a640bb5e986a62097 100644 (file)
@@ -469,7 +469,7 @@ ldap_back_monitor_db_open( BackendDB *be )
        ptr = lutil_strncopy( ptr, suffix.bv_val, suffix.bv_len );
        ptr = lutil_strcopy( ptr, "))" );
        ptr[ 0 ] = '\0';
-       assert( filter->bv_len == ptr - filter->bv_val );
+       assert( ptr == &filter->bv_val[ filter->bv_len ] );
 
        if ( suffix.bv_val != be->be_nsuffix[ 0 ].bv_val ) {
                ch_free( suffix.bv_val );
index 9d33ceaa136cbd1fb61dbd588b373c3e580724fe..d6b4dd1abf9893ff1d00f4f0d4f3f1fa5d45c621 100644 (file)
@@ -3948,10 +3948,10 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
                        isconfig = 1;
        }
        ptr1 = ber_bvchr( &e->e_name, '{' );
-       if ( ptr1 && ptr1 - e->e_name.bv_val < rdn.bv_len ) {
+       if ( ptr1 && ptr1 < &e->e_name.bv_val[ rdn.bv_len ] ) {
                char    *next;
                ptr2 = strchr( ptr1, '}' );
-               if (!ptr2 || ptr2 - e->e_name.bv_val > rdn.bv_len)
+               if ( !ptr2 || ptr2 > &e->e_name.bv_val[ rdn.bv_len ] )
                        return LDAP_NAMING_VIOLATION;
                if ( ptr2-ptr1 == 1)
                        return LDAP_NAMING_VIOLATION;
index 0be32e9bfabe48c6680cc08de515d2d71f3a288e..a6b261377b4366534665f86e92f1cb7afeda4e6c 100644 (file)
@@ -1400,7 +1400,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
                attr_merge_one( e, ad_reqMessage, &bv, NULL );
        }
        bv.bv_len = snprintf( timebuf, sizeof( timebuf ), "%d", rs->sr_err );
-       if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+       if ( bv.bv_len < sizeof( timebuf ) ) {
                bv.bv_val = timebuf;
                attr_merge_one( e, ad_reqResult, &bv, NULL );
        }
@@ -1617,17 +1617,17 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
                }
                bv.bv_val = timebuf;
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", rs->sr_nentries );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqEntries, &bv, NULL );
                } /* else? */
 
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_tlimit );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqTimeLimit, &bv, NULL );
                } /* else? */
 
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_slimit );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqSizeLimit, &bv, NULL );
                } /* else? */
                break;
@@ -1635,7 +1635,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
        case LOG_EN_BIND:
                bv.bv_val = timebuf;
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->o_protocol );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqVersion, &bv, NULL );
                } /* else? */
                if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
@@ -1838,7 +1838,7 @@ accesslog_abandon( Operation *op, SlapReply *rs )
        e = accesslog_entry( op, rs, LOG_EN_ABANDON, &op2 );
        bv.bv_val = buf;
        bv.bv_len = snprintf( buf, sizeof( buf ), "%d", op->orn_msgid );
-       if ( bv.bv_len >= 0 && bv.bv_len < sizeof( buf ) ) {
+       if ( bv.bv_len < sizeof( buf ) ) {
                attr_merge_one( e, ad_reqId, &bv, NULL );
        } /* else? */
 
index ea01254d18a12e29147a498b34d6c3ce17232b8e..5ecfc3fb5efc46d2697d115a2109952a5440c6a8 100644 (file)
@@ -2712,7 +2712,7 @@ pc_cfadd( Operation *op, SlapReply *rs, Entry *p, ConfigArgs *ca )
        /* FIXME: should not hardcode "olcDatabase" here */
        bv.bv_len = snprintf( ca->cr_msg, sizeof( ca->cr_msg ),
                "olcDatabase=%s", cm->db.bd_info->bi_type );
-       if ( bv.bv_len < 0 || bv.bv_len >= sizeof( ca->cr_msg ) ) {
+       if ( bv.bv_len >= sizeof( ca->cr_msg ) ) {
                return -1;
        }
        bv.bv_val = ca->cr_msg;
index e05ee7fe4749ab497f6b290144f5b2f7f0b1d8b8..db113f042be0ff142df37556fb467e8ef86027f3 100644 (file)
@@ -627,7 +627,7 @@ again:
                cf.f_av_value = si->si_ctxcsn[maxid];
                fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
                        "(entryCSN>=%s)", cf.f_av_value.bv_val );
-               if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+               if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
                        return LDAP_OTHER;
                }
                fop.ors_attrsonly = 0;
@@ -664,7 +664,7 @@ again:
                        fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
                                "(entryCSN<=%s)", cf.f_av_value.bv_val );
                }
-               if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+               if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
                        return LDAP_OTHER;
                }
                fop.ors_attrsonly = 1;
@@ -2532,7 +2532,7 @@ sp_cf_gen(ConfigArgs *c)
                                struct berval bv;
                                bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                        "%d %d", si->si_chkops, si->si_chktime );
-                               if ( bv.bv_len < 0 || bv.bv_len >= sizeof( c->cr_msg ) ) {
+                               if ( bv.bv_len >= sizeof( c->cr_msg ) ) {
                                        rc = 1;
                                } else {
                                        bv.bv_val = c->cr_msg;
index 70d763f11e6a60acf709818afca989eaa46847bb..e87cbe4632aa3dd05aeaef704efe84abdabbcafc 100644 (file)
@@ -159,7 +159,7 @@ translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
        /* FIXME: should not hardcode "olcDatabase" here */
        bv.bv_len = snprintf( ca->cr_msg, sizeof( ca->cr_msg ),
                "olcDatabase=%s", ov->db.bd_info->bi_type );
-       if ( bv.bv_len < 0 || bv.bv_len >= sizeof( ca->cr_msg ) ) {
+       if ( bv.bv_len >= sizeof( ca->cr_msg ) ) {
                return -1;
        }
        bv.bv_val = ca->cr_msg;
index 0a300fa879fe107e78f7a31cb8c98a1af5279348..0f8b909a9ed9c9ebee378c6d2eff09c44352e48c 100644 (file)
@@ -397,7 +397,8 @@ slap_auxprop_store(
        Operation op = {0};
        Opheader oph;
        SlapReply rs = {REP_RESULT};
-       int rc, i, j;
+       int rc, i;
+       unsigned j;
        Connection *conn = NULL;
        const struct propval *pr;
        Modifications *modlist = NULL, **modtail = &modlist, *mod;