]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
Move `#include "ldap_defaults.h"' into slap.h, which #ifdefs on it.
[openldap] / servers / slapd / attr.c
index 589291b943629a0b3637776316e87f750ca4f07a..4492028a07d51202d65deca662ee81f5bacdc8b1 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /* attr.c - routines for dealing with attributes */
 
 #include "portable.h"
@@ -18,7 +22,7 @@
 #include <sys/param.h>
 #endif
 
-#include "ldap_defaults.h"
+#include "ldap_pvt.h"
 #include "slap.h"
 
 #ifdef LDAP_DEBUG
@@ -63,6 +67,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;
@@ -105,7 +111,7 @@ attr_normalize( char *s )
 {
        assert( s != NULL );
 
-       return( str2lower( s ) );
+       return( ldap_pvt_str2lower( s ) );
 }
 
 /*
@@ -187,7 +193,7 @@ attr_merge(
 Attribute *
 attr_find(
     Attribute  *a,
-    char       *type
+    const char *type
 )
 {
        for ( ; a != NULL; a = a->a_next ) {
@@ -209,7 +215,7 @@ attr_find(
 int
 attr_delete(
     Attribute  **attrs,
-    char       *type
+    const char *type
 )
 {
        Attribute       **a;
@@ -257,7 +263,7 @@ attr_syntax( char *type )
 
 void
 attr_syntax_config(
-    char       *fname,
+    const char *fname,
     int                lineno,
     int                argc,
     char       **argv
@@ -689,8 +695,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 {