asn1: Close _files output last

This commit is contained in:
Nicolas Williams
2022-01-05 17:50:00 -06:00
parent 9427796f1a
commit 01b1916ec2
2 changed files with 14 additions and 6 deletions

View File

@@ -356,11 +356,19 @@ close_generate (void)
err(1, "writes to private header file failed");
if (templatefile && fclose(templatefile) == EOF)
err(1, "writes to template file failed");
if (logfile) {
fprintf(logfile, "\n");
if (fclose(logfile) == EOF)
err(1, "writes to log file failed");
}
if (!jsonfile) abort();
if (fclose(jsonfile) == EOF)
err(1, "writes to JSON file failed");
if (!oidsfile) abort();
if (fclose(oidsfile) == EOF)
err(1, "writes to OIDs file failed");
if (!symsfile) abort();
if (fclose(symsfile) == EOF)
err(1, "writes to symbols file failed");
if (!logfile) abort();
fprintf(logfile, "\n");
if (fclose(logfile) == EOF)
err(1, "writes to log file failed");
}
void

View File

@@ -316,12 +316,12 @@ main(int argc, char **argv)
exit(1);
if (!original_order)
generate_types();
close_generate ();
if (argc != optidx)
fclose(yyin);
if (one_code_file)
close_codefile();
close_generate();
if (arg) {
for (i = 1; i < len; i++)