X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Ferr%2Ferr_prn.c;h=6f60b016c324d6d335c6f678c0d710218c5781ee;hp=16e313879d63aeef3f8da85c660e2fd6ab9ae788;hb=e5c84d5152c11a3dfa436041d3336a6f403baad8;hpb=b7896b3cb86d80206af14a14d69b0717786f2729 diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 16e313879d..6f60b016c3 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -1,5 +1,5 @@ /* crypto/err/err_prn.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -57,46 +57,51 @@ */ #include -#include "lhash.h" -#include "crypto.h" +#include +#include #include "cryptlib.h" -#include "buffer.h" -#include "err.h" -#include "crypto.h" +#include +#include +#include -#ifndef WIN16 -void ERR_print_errors_fp(fp) -FILE *fp; +#ifndef NO_FP_API +void ERR_print_errors_fp(FILE *fp) { unsigned long l; char buf[200]; - char *file; - int line; + const char *file,*data; + int line,flags; unsigned long es; es=CRYPTO_thread_id(); - while ((l=ERR_get_error_line(&file,&line)) != 0) - fprintf(fp,"%lu:%s:%s:%d\n",es,ERR_error_string(l,buf), - file,line); + while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) + { + ERR_error_string_n(l, buf, sizeof buf); + fprintf(fp,"%lu:%s:%s:%d:%s\n",es,buf, + file,line,(flags&ERR_TXT_STRING)?data:""); + } } #endif -void ERR_print_errors(bp) -BIO *bp; +void ERR_print_errors(BIO *bp) { unsigned long l; char buf[256]; char buf2[256]; - char *file; - int line; + const char *file,*data; + int line,flags; unsigned long es; es=CRYPTO_thread_id(); - while ((l=ERR_get_error_line(&file,&line)) != 0) + while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) { - sprintf(buf2,"%lu:%s:%s:%d\n",es,ERR_error_string(l,buf), + ERR_error_string_n(l, buf, sizeof buf); + sprintf(buf2,"%lu:%s:%s:%d:",es,buf, file,line); BIO_write(bp,buf2,strlen(buf2)); + if (flags & ERR_TXT_STRING) + BIO_write(bp,data,strlen(data)); + BIO_write(bp,"\n",1); } }