Warning cleanup: Remove no-op bv_len < 0 and bv_len >= 0 tests

This commit is contained in:
Hallvard Furuseth 2008-10-17 17:40:48 +00:00
parent 0d7ee548e1
commit e3bc5b64c6
4 changed files with 11 additions and 11 deletions

View 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? */

View 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;

View 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;

View 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;