diff options
author | Andy Polyakov <appro@openssl.org> | 2010-04-20 20:28:30 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2010-04-20 20:28:30 +0000 |
commit | b8febed96a78ba971553cc4efb13a44daecef383 (patch) | |
tree | 6a9b5d74a87de4ee115600a76f2c2cb08bf7baa3 /crypto/err | |
parent | 82687bb4c3b462bc2324eefe927a9f557aef1da7 (diff) |
Prevent ERR_print_errors_fp crash on Win32 [from HEAD].
Diffstat (limited to 'crypto/err')
-rw-r--r-- | crypto/err/err_prn.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 4cdf342fa6..c298e16164 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -86,7 +86,12 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), #ifndef OPENSSL_NO_FP_API static int print_fp(const char *str, size_t len, void *fp) { - return fwrite(str, 1, len, fp); + BIO bio; + + BIO_set(&bio,BIO_s_file()); + BIO_set_fp(&bio,fp,BIO_NOCLOSE); + + return BIO_printf(&bio, "%s", str); } void ERR_print_errors_fp(FILE *fp) { |