X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fentry.c;h=181a2933a17f100eff3340c847ab2b3aed28fbec;hb=ed471a4d53b9bcd2cc89410743ffb4bd58b5fc05;hp=98f5842f8a45e66f9544ee3430d512900406c6dd;hpb=6107ba67d2fd7eadb23ffdd1d284306011ef4013;p=openldap diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 98f5842f8a..181a2933a1 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -112,15 +112,13 @@ str2entry( char *s ) #ifdef NEW_LOGGING LDAP_LOG( OPERATION, DETAIL1, "str2entry: " "entry %ld has multiple DNs \"%s\" and \"%s\"\n", - (long) e->e_id, e->e_dn, - vals[0].bv_val != NULL ? vals[0].bv_val : "" ); + (long) e->e_id, e->e_dn, vals[0].bv_val ); #else Debug( LDAP_DEBUG_ANY, "str2entry: " "entry %ld has multiple DNs \"%s\" and \"%s\"\n", - (long) e->e_id, e->e_dn, - vals[0].bv_val != NULL ? vals[0].bv_val : "" ); + (long) e->e_id, e->e_dn, vals[0].bv_val ); #endif - if( vals[0].bv_val != NULL ) free( vals[0].bv_val ); + free( vals[0].bv_val ); entry_free( e ); return NULL; } @@ -390,17 +388,19 @@ entry_cmp( Entry *e1, Entry *e2 ) } int -entry_dn_cmp( Entry *e1, Entry *e2 ) +entry_dn_cmp( const void *v_e1, const void *v_e2 ) { /* compare their normalized UPPERCASED dn's */ + const Entry *e1 = v_e1, *e2 = v_e2; int rc = e1->e_nname.bv_len - e2->e_nname.bv_len; if (rc) return rc; return( strcmp( e1->e_ndn, e2->e_ndn ) ); } int -entry_id_cmp( Entry *e1, Entry *e2 ) +entry_id_cmp( const void *v_e1, const void *v_e2 ) { + const Entry *e1 = v_e1, *e2 = v_e2; return( e1->e_id < e2->e_id ? -1 : (e1->e_id > e2->e_id ? 1 : 0) ); }