summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-23 09:43:35 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-23 09:43:35 +0100
commitf689984f35225f6e93ff2614df65a03de1cad8c4 (patch)
tree0024a090d1d638ce197af6748f2c1b7ec3b7cd7e
parentec008afd281367757fe2f05c844cddfc8cabd7f8 (diff)
downloadlibtasn1-f689984f35225f6e93ff2614df65a03de1cad8c4.tar.gz
libtasn1-f689984f35225f6e93ff2614df65a03de1cad8c4.tar.bz2
libtasn1-f689984f35225f6e93ff2614df65a03de1cad8c4.zip
better error printing
-rw-r--r--lib/ASN1.c3
-rw-r--r--lib/ASN1.y3
-rw-r--r--src/asn1Parser.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 430e2ff..075c81c 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -3021,6 +3021,9 @@ _asn1_create_errorDescription (int error, char *error_desc)
switch (error)
{
+ case ASN1_FILE_NOT_FOUND:
+ snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name);
+ break;
case ASN1_SYNTAX_ERROR:
strcpy(error_desc, last_error);
break;
diff --git a/lib/ASN1.y b/lib/ASN1.y
index 70e39a3..d975632 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -607,6 +607,9 @@ _asn1_create_errorDescription (int error, char *error_desc)
switch (error)
{
+ case ASN1_FILE_NOT_FOUND:
+ snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name);
+ break;
case ASN1_SYNTAX_ERROR:
strcpy(error_desc, last_error);
break;
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index f19a9ef..64bf16b 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -174,7 +174,7 @@ main (int argc, char *argv[])
fputs ("Done.\n", stderr);
break;
case ASN1_FILE_NOT_FOUND:
- fprintf (stderr, "asn1Parser: FILE %s NOT FOUND\n",
+ fprintf (stderr, "asn1Parser: file %s was not found\n",
inputFileName);
break;
case ASN1_SYNTAX_ERROR: