]> git.sur5r.net Git - openldap/commitdiff
ITS#2128, setvbuf is unreliable
authorHoward Chu <hyc@openldap.org>
Wed, 27 Nov 2002 04:13:19 +0000 (04:13 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 27 Nov 2002 04:13:19 +0000 (04:13 +0000)
libraries/liblber/stdio.c

index 0c5205ac80e113b52c97790579ee84d5729b8042..4dd47535b6cbce6f0fae43e2230d498a59ce21f0 100644 (file)
@@ -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