/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2010 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
struct berval *normal,
void *ctx)
{
- Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val ? val->bv_val : "", 0, 0 );
-
assert( val != NULL );
assert( pretty != NULL );
assert( normal != NULL );
+ Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val ? val->bv_val : "", 0, 0 );
if ( val->bv_len == 0 ) {
ber_dupbv_x( pretty, val, ctx );
const struct berval *dn,
const struct berval *suffix )
{
- int d = dn->bv_len - suffix->bv_len;
+ int d;
assert( dn != NULL );
assert( suffix != NULL );
+ d = dn->bv_len - suffix->bv_len;
+
/* empty suffix matches any dn */
if ( suffix->bv_len == 0 ) {
return 1;
}
/* compare */
- return( strcmp( dn->bv_val + d, suffix->bv_val ) == 0 );
+ return( strncmp( dn->bv_val + d, suffix->bv_val, suffix->bv_len ) == 0 );
}
/*