On Thu, May 12, 2005, Angel Martinez Gonzalez wrote:

> Hello:
> 
> I tried your advice but I obtain the same result. I have tried the
> following:
> 
> ERR_load_crypto_strings();
> 
> printf ("error: %i\n",ERR_get_error());
> printf(ERR_error_string(ERR_get_error(), NULL));
> printf(ERR_lib_error_string(ERR_get_error()));
> printf(ERR_func_error_string(ERR_get_error()));
> printf(ERR_reason_error_string(ERR_get_error()));
> fflush(stdout);
> 
> This code only show:
> 
> error: 0
> error:00000000:lib(0):func(0):reason(0)
> 
> But it not show a human-readable string representing the error code. Why?. I
> have load the OpenSSL error strings by calling:
>         ERR_load_crypto_strings();
> 
> Why it not show the string representing the error code?.
> 
> Thanks for you help.
> 
> 

That's because there isn't any error. 

Its not a good idea to manually use the error library like that for simply
printing out error codes unless you have to. Several pieces of software (many
of which should know better!) do because they want to customize the error
behaviou and frequently exclude such things as the additional error data (which
the code snippet above does too) which makes errror messages less useful.

Are you sure what you are doing should produce an error? Try deliberately
creating an error and printing it out with something like:

BIO_new_file("some_file_name_that_does_not_exist", "r");
ERR_print_errors_fp(stderr);

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to