diff options
| author | Matthew Garrett <mjg@redhat.com> | 2012-07-02 12:33:42 -0400 |
|---|---|---|
| committer | Matthew Garrett <mjg@redhat.com> | 2012-07-02 12:33:42 -0400 |
| commit | e21cbf4d9bafebb2560d1acac1e47e879c7f7493 (patch) | |
| tree | 308e31c8b7338e11843ac324ce20b89d765c3f45 /Cryptlib/OpenSSL/crypto/err/err_prn.c | |
| parent | 5b1bf5583c3b6b523446b2b938f5f8355f488052 (diff) | |
| download | efi-boot-shim-e21cbf4d9bafebb2560d1acac1e47e879c7f7493.tar.gz efi-boot-shim-e21cbf4d9bafebb2560d1acac1e47e879c7f7493.zip | |
Update OpenSSL
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/err/err_prn.c')
| -rwxr-xr-x | Cryptlib/OpenSSL/crypto/err/err_prn.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Cryptlib/OpenSSL/crypto/err/err_prn.c b/Cryptlib/OpenSSL/crypto/err/err_prn.c index 4cdf342f..1e46f93e 100755 --- a/Cryptlib/OpenSSL/crypto/err/err_prn.c +++ b/Cryptlib/OpenSSL/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) { |
