From: Howard Chu Date: Mon, 27 Nov 2006 18:59:04 +0000 (+0000) Subject: define LDIF_MAXLINE instead of using BUFSIZ X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~437 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9446f8554b7173c2b73a6e7710e95c89808bbefb;p=thirdparty%2Fopenldap.git define LDIF_MAXLINE instead of using BUFSIZ --- diff --git a/libraries/liblutil/ldif.c b/libraries/liblutil/ldif.c index c639f87562..361a5a37b2 100644 --- a/libraries/liblutil/ldif.c +++ b/libraries/liblutil/ldif.c @@ -777,6 +777,8 @@ ldif_close( } } +#define LDIF_MAXLINE 4096 + /* * ldif_read_record - read an ldif record. Return 1 for success, 0 for EOF. */ @@ -787,7 +789,7 @@ ldif_read_record( char **bufp, /* ptr to malloced output buffer */ int *buflenp ) /* ptr to length of *bufp */ { - char linebuf[BUFSIZ], *line, *nbufp; + char linebuf[LDIF_MAXLINE], *line, *nbufp; ber_len_t lcur = 0, len, linesize; int last_ch = '\n', found_entry = 0, stop, top_comment = 0; @@ -882,7 +884,7 @@ ldif_read_record( } if ( *buflenp - lcur <= len ) { - *buflenp += len + BUFSIZ; + *buflenp += len + LDIF_MAXLINE; nbufp = ber_memrealloc( *bufp, *buflenp ); if( nbufp == NULL ) { return 0;