summaryrefslogtreecommitdiff
path: root/src/asn1Coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/asn1Coding.c')
-rw-r--r--src/asn1Coding.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 106e0d0..3230984 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -309,29 +309,31 @@ main (int argc, char *argv[])
asn1_delete_structure (&definitions);
asn1_delete_structure (&structure);
+ if (!checkSyntaxOnly)
+ {
+ if (outputFileName == NULL)
+ createFileName (inputFileAssignmentName, &outputFileName);
- if (outputFileName == NULL)
- createFileName (inputFileAssignmentName, &outputFileName);
+ printf ("\nOutputFile=%s\n", outputFileName);
- printf ("\nOutputFile=%s\n", outputFileName);
+ outputFile = fopen (outputFileName, "w");
- outputFile = fopen (outputFileName, "w");
+ if (outputFile == NULL)
+ {
+ printf ("asn1Coding: output file '%s' not available\n", outputFileName);
+ free (der);
+ free (inputFileAsnName);
+ free (inputFileAssignmentName);
+ free (outputFileName);
+ exit (1);
+ }
- if (outputFile == NULL)
- {
- printf ("asn1Coding: output file '%s' not available\n", outputFileName);
- free (der);
- free (inputFileAsnName);
- free (inputFileAssignmentName);
- free (outputFileName);
- exit (1);
+ for (k = 0; k < der_len; k++)
+ fprintf (outputFile, "%c", der[k]);
+ fclose (outputFile);
+ printf ("\nWriting: done.\n");
}
- for (k = 0; k < der_len; k++)
- fprintf (outputFile, "%c", der[k]);
- fclose (outputFile);
- printf ("\nWriting: done.\n");
-
free (der);
free (inputFileAsnName);