diff options
author | Ivan Shmakov <oneingray@gmail.com> | 2012-11-06 23:16:03 +0700 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-06 17:26:43 +0100 |
commit | 708e5101fa8b1d4ee2b1dc8247216ea34182a963 (patch) | |
tree | eae7f594499f5e665378a9b14f5aceda40689b5c /src/asn1Decoding.c | |
parent | 05945e2cc4b3bf1af7af21589cd377310b03f9dd (diff) | |
download | libtasn1-708e5101fa8b1d4ee2b1dc8247216ea34182a963.tar.gz libtasn1-708e5101fa8b1d4ee2b1dc8247216ea34182a963.tar.bz2 libtasn1-708e5101fa8b1d4ee2b1dc8247216ea34182a963.zip |
use stderr for status messages in asn1{Coding, Decoding, Parser}
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'src/asn1Decoding.c')
-rw-r--r-- | src/asn1Decoding.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c index ee09e18..00156c5 100644 --- a/src/asn1Decoding.c +++ b/src/asn1Decoding.c @@ -144,18 +144,20 @@ main (int argc, char *argv[]) switch (asn1_result) { case ASN1_SUCCESS: - printf ("Parse: done.\n"); + fprintf (stderr, "Parse: done.\n"); break; case ASN1_FILE_NOT_FOUND: - printf ("asn1Decoding: FILE %s NOT FOUND\n", inputFileAsnName); + fprintf (stderr, "asn1Decoding: FILE %s NOT FOUND\n", + inputFileAsnName); break; case ASN1_SYNTAX_ERROR: case ASN1_IDENTIFIER_NOT_FOUND: case ASN1_NAME_TOO_LONG: - printf ("asn1Decoding: %s\n", errorDescription); + fprintf (stderr, "asn1Decoding: %s\n", errorDescription); break; default: - printf ("libtasn1 ERROR: %s\n", asn1_strerror (asn1_result)); + fprintf (stderr, "libtasn1 ERROR: %s\n", + asn1_strerror (asn1_result)); } if (asn1_result != ASN1_SUCCESS) @@ -175,7 +177,8 @@ main (int argc, char *argv[]) if (der == NULL) { - printf ("asn1Decoding: could not read '%s'\n", inputFileDerName); + fprintf (stderr, "asn1Decoding: could not read '%s'\n", + inputFileDerName); asn1_delete_structure (&definitions); free (inputFileAsnName); @@ -238,7 +241,8 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; if (asn1_result != ASN1_SUCCESS) { - printf ("Structure creation: %s\n", asn1_strerror (asn1_result)); + fprintf (stderr, "Structure creation: %s\n", + asn1_strerror (asn1_result)); asn1_delete_structure (&structure); return asn1_result; } @@ -246,17 +250,18 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; asn1_result = asn1_der_decoding (&structure, der, der_len, errorDescription); - if (!benchmark) printf ("\nDecoding: %s\n", asn1_strerror (asn1_result)); + if (!benchmark) + fprintf (stderr, "\nDecoding: %s\n", asn1_strerror (asn1_result)); if (asn1_result != ASN1_SUCCESS) { - printf ("asn1Decoding: %s\n", errorDescription); + fprintf (stderr, "asn1Decoding: %s\n", errorDescription); asn1_delete_structure (&structure); return asn1_result; } if (!benchmark) { - printf ("\nDECODING RESULT:\n"); + fprintf (stderr, "\nDECODING RESULT:\n"); asn1_print_structure (stdout, structure, "", ASN1_PRINT_NAME_TYPE_VALUE); } asn1_delete_structure (&structure); |