From: Howard Chu Date: Wed, 27 Nov 2002 04:13:19 +0000 (+0000) Subject: ITS#2128, setvbuf is unreliable X-Git-Tag: NO_SLAP_OP_BLOCKS~764 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=10a194feb5f227369c11317c0ab9988231593784;p=openldap ITS#2128, setvbuf is unreliable --- diff --git a/libraries/liblber/stdio.c b/libraries/liblber/stdio.c index 0c5205ac80..4dd47535b6 100644 --- a/libraries/liblber/stdio.c +++ b/libraries/liblber/stdio.c @@ -55,6 +55,9 @@ int ber_pvt_vsnprintf( char *str, size_t n, const char *fmt, va_list ap ) fclose( f ); signal( SIGPIPE, sig ); + if ( res > 0 && res < n ) { + res = vsprintf( str, fmt, ap ); + } return res; } #endif