LBER_F( struct berval * )
ber_str2bv LDAP_P((
- LDAP_CONST char *, int dup, struct berval *bv ));
+ LDAP_CONST char *, ber_len_t len, int dup, struct berval *bv));
-#define ber_bvstr(a) ber_str2bv(a, 0, NULL)
-#define ber_bvstrdup(a) ber_str2bv(a, 1, NULL)
+#define ber_bvstr(a) ber_str2bv(a, 0, 0, NULL)
+#define ber_bvstrdup(a) ber_str2bv(a, 0, 1, NULL)
LBER_F( char * )
ber_strdup LDAP_P((
struct berval *
ber_str2bv(
- LDAP_CONST char *s, int dup, struct berval *bv )
+ LDAP_CONST char *s, ber_len_t len, int dup, struct berval *bv)
{
struct berval *new;
}
}
- new->bv_len = strlen( s );
+ new->bv_len = len ? len : strlen( s );
if ( dup ) {
if ( (new->bv_val = LBER_MALLOC( new->bv_len+1 )) == NULL ) {
ber_errno = LBER_ERROR_MEMORY;