diff --git a/include/ldif.h b/include/ldif.h index 926bb0208e..4ae6468eb8 100644 --- a/include/ldif.h +++ b/include/ldif.h @@ -33,7 +33,7 @@ LDAP_BEGIN_DECL /* This is NOT a bogus extern declaration (unlike ldap_debug) */ LDAP_LDIF_V (int) ldif_debug; -#define LDIF_LINE_WIDTH 76 /* default maximum length of LDIF lines */ +#define LDIF_LINE_WIDTH 78 /* default maximum length of LDIF lines */ #define LDIF_LINE_WIDTH_MAX ((ber_len_t)-1) /* maximum length of LDIF lines */ #define LDIF_LINE_WIDTH_WRAP(wrap) ((wrap) == 0 ? LDIF_LINE_WIDTH : (wrap)) @@ -50,9 +50,7 @@ LDAP_LDIF_V (int) ldif_debug; * first newline + base64 value + continued lines. Each continued line * needs room for a newline and a leading space character. */ -#define LDIF_SIZE_NEEDED(nlen,vlen) \ - ((nlen) + 4 + LDIF_BASE64_LEN(vlen) \ - + ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / (LDIF_LINE_WIDTH-1) * 2 )) +#define LDIF_SIZE_NEEDED(nlen,vlen) LDIF_SIZE_NEEDED_WRAP(nlen, vlen, 0) #define LDIF_SIZE_NEEDED_WRAP(nlen,vlen,wrap) \ ((nlen) + 4 + LDIF_BASE64_LEN(vlen) \ diff --git a/libraries/libldap/ldif.c b/libraries/libldap/ldif.c index 7b10b78bcb..8e84a898d8 100644 --- a/libraries/libldap/ldif.c +++ b/libraries/libldap/ldif.c @@ -432,9 +432,6 @@ ldif_must_b64_encode( LDAP_CONST char *s ) return 0; } -/* compatibility with U-Mich off by two bug */ -#define LDIF_KLUDGE 2 - /* NOTE: only preserved for binary compatibility */ void ldif_sput( @@ -444,7 +441,7 @@ ldif_sput( LDAP_CONST char *val, ber_len_t vlen ) { - ldif_sput_wrap( out, type, name, val, vlen, LDIF_LINE_WIDTH+LDIF_KLUDGE ); + ldif_sput_wrap( out, type, name, val, vlen, 0 ); } void @@ -468,7 +465,7 @@ ldif_sput_wrap( ber_len_t i; if ( !wrap ) - wrap = LDIF_LINE_WIDTH+LDIF_KLUDGE; + wrap = LDIF_LINE_WIDTH; /* prefix */ switch( type ) { @@ -664,7 +661,7 @@ ldif_put( LDAP_CONST char *val, ber_len_t vlen ) { - return ldif_put_wrap( type, name, val, vlen, LDIF_LINE_WIDTH ); + return ldif_put_wrap( type, name, val, vlen, 0 ); } char *