]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/value.c
Remove lint
[openldap] / servers / slapd / value.c
index 002a105ab36aad5cd4c7ede354cecb4992ec15e8..b1288d07369ce3e7b24aaf0afc99196d40379cd0 100644 (file)
@@ -53,6 +53,36 @@ value_add(
        return LDAP_SUCCESS;
 }
 
+int
+value_add_one( 
+    BerVarray *vals,
+    struct berval *addval
+)
+{
+       int     n;
+       BerVarray v2;
+
+       if ( *vals == NULL ) {
+               *vals = (BerVarray) ch_malloc( 2 * sizeof(struct berval) );
+               n = 0;
+       } else {
+               for ( n = 0; (*vals)[n].bv_val != NULL; n++ ) {
+                       ;       /* Empty */
+               }
+               *vals = (BerVarray) ch_realloc( (char *) *vals,
+                   (n + 2) * sizeof(struct berval) );
+       }
+
+       v2 = *vals + n;
+       ber_dupbv(v2, addval);
+
+       v2++;
+       v2->bv_val = NULL;
+       v2->bv_len = 0;
+
+       return LDAP_SUCCESS;
+}
+
 int
 value_validate(
        MatchingRule *mr,
@@ -300,7 +330,6 @@ int value_find_ex(
        int     i;
        int rc;
        struct berval nval = { 0, NULL };
-       struct berval nval_tmp;
        MatchingRule *mr = ad->ad_type->sat_equality;
 
        if( mr == NULL || !mr->smr_match ) {
@@ -321,8 +350,11 @@ int value_find_ex(
        }
 
        if( mr->smr_syntax->ssyn_normalize ) {
+               struct berval nval_tmp = { 0, NULL };
+
                rc = mr->smr_syntax->ssyn_normalize(
-                       mr->smr_syntax, nval.bv_val == NULL ? val : &nval, &nval_tmp );
+                       mr->smr_syntax,
+                       nval.bv_val == NULL ? val : &nval, &nval_tmp );
 
                free(nval.bv_val);
                nval = nval_tmp;