]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / slapd / attr.c
index bfdbc3c4edef588688fc6a71fbf1f450df9acd40..8a5f5358cb2f8d263937370fe0bdf455da94dbef 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -22,7 +23,7 @@
 #include <sys/param.h>
 #endif
 
-#include "ldap_defaults.h"
+#include "ldap_pvt.h"
 #include "slap.h"
 
 #ifdef LDAP_DEBUG
@@ -67,6 +68,8 @@ Attribute *attr_dup( Attribute *a )
 
                for( i=0; a->a_vals[i] != NULL; i++ ) {
                        tmp->a_vals[i] = ber_bvdup( a->a_vals[i] );
+
+                       if( tmp->a_vals[i] == NULL ) break;
                }
 
                tmp->a_vals[i] = NULL;
@@ -109,7 +112,7 @@ attr_normalize( char *s )
 {
        assert( s != NULL );
 
-       return( str2lower( s ) );
+       return( ldap_pvt_str2lower( s ) );
 }
 
 /*
@@ -321,7 +324,7 @@ attr_syntax_config(
 
        save = argv[lasti];
        argv[lasti] = NULL;
-       at->at_names = charray_dup( (const char **) argv );
+       at->at_names = charray_dup( argv );
        argv[lasti] = save;
 
        code = at_add( at, &err );
@@ -693,8 +696,8 @@ at_schema_info( Entry *e )
                val.bv_val = ldap_attributetype2str( &at->sat_atype );
                if ( val.bv_val ) {
                        val.bv_len = strlen( val.bv_val );
-                       Debug( LDAP_DEBUG_TRACE, "Merging at [%d] %s\n",
-                              val.bv_len, val.bv_val, 0 );
+                       Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
+                              (long) val.bv_len, val.bv_val, 0 );
                        attr_merge( e, "attributeTypes", vals );
                        ldap_memfree( val.bv_val );
                } else {