diff options
| author | Simon L. B. Nielsen <simon@FreeBSD.org> | 2010-11-21 22:45:18 +0000 | 
|---|---|---|
| committer | Simon L. B. Nielsen <simon@FreeBSD.org> | 2010-11-21 22:45:18 +0000 | 
| commit | f2c43d19b91f8847c1dfd87721254b44f963d9a2 (patch) | |
| tree | 4710d37952455e247de95eedf55ea05ee4df9f69 /crypto/err/err_prn.c | |
| parent | 0cedaa6c89235ed396068f2ebf546c9a909439e1 (diff) | |
Diffstat (limited to 'crypto/err/err_prn.c')
| -rw-r--r-- | crypto/err/err_prn.c | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 4cdf342fa634..1e46f93ecf81 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)  	{ | 
