X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fattr.c;h=8a5f5358cb2f8d263937370fe0bdf455da94dbef;hb=403f4479bc9f9a864122d4aeecf7284408918302;hp=59cd1452c795f9e5e80ccd037680e97b4abff852;hpb=51d16c18a9f98db224e8008a955d6444b1d2e162;p=openldap diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 59cd1452c7..8a5f5358cb 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -1,3 +1,8 @@ +/* $OpenLDAP$ */ +/* + * 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 +23,7 @@ #include #endif -#include "ldap_defaults.h" +#include "ldap_pvt.h" #include "slap.h" #ifdef LDAP_DEBUG @@ -63,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; @@ -105,7 +112,7 @@ attr_normalize( char *s ) { assert( s != NULL ); - return( str2lower( s ) ); + return( ldap_pvt_str2lower( s ) ); } /* @@ -187,7 +194,7 @@ attr_merge( Attribute * attr_find( Attribute *a, - char *type + const char *type ) { for ( ; a != NULL; a = a->a_next ) { @@ -209,7 +216,7 @@ attr_find( int attr_delete( Attribute **attrs, - char *type + const char *type ) { Attribute **a; @@ -257,7 +264,7 @@ attr_syntax( char *type ) void attr_syntax_config( - char *fname, + const char *fname, int lineno, int argc, char **argv @@ -324,7 +331,7 @@ attr_syntax_config( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), err); - exit( 1 ); + exit( EXIT_FAILURE ); } ldap_memfree(at); } @@ -689,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 {