summaryrefslogtreecommitdiffstats
path: root/crypto/err
diff options
context:
space:
mode:
authorsimon <simon@FreeBSD.org>2010-11-21 22:45:18 +0000
committersimon <simon@FreeBSD.org>2010-11-21 22:45:18 +0000
commit94e5505da619159032deac31ce95e6677cb94508 (patch)
tree4710d37952455e247de95eedf55ea05ee4df9f69 /crypto/err
parentd92ad4708f8e42fced6b82ddee1930a3e4f6e342 (diff)
downloadFreeBSD-src-94e5505da619159032deac31ce95e6677cb94508.zip
FreeBSD-src-94e5505da619159032deac31ce95e6677cb94508.tar.gz
Import OpenSSL 0.9.8p.
Diffstat (limited to 'crypto/err')
-rw-r--r--crypto/err/err_prn.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index 4cdf342..1e46f93 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -79,14 +79,20 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
ERR_error_string_n(l, buf, sizeof buf);
BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
file, line, (flags & ERR_TXT_STRING) ? data : "");
- cb(buf2, strlen(buf2), u);
+ if (cb(buf2, strlen(buf2), u) <= 0)
+ break; /* abort outputting the error report */
}
}
#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)
{
OpenPOWER on IntegriCloud