From 42fd03f75d3ebb57d1516f9332f915c4c8cef9be Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 16 Sep 2024 00:05:55 +0200 Subject: [PATCH] do not create output file on error --- source/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/main.c b/source/main.c index 993534a..eb547b4 100644 --- a/source/main.c +++ b/source/main.c @@ -114,7 +114,6 @@ signed main(const int argc, const char * const * const argv) { tbsp_c_yy_init(); CHECKED_FOPEN(yyin, input_file_name, "r"); - CHECKED_FOPEN(yyout, output_file_name, "w"); int yyparse_r = yyparse(); if (yyparse_r) { return yyparse_r; } @@ -134,6 +133,8 @@ signed main(const int argc, const char * const * const argv) { free(verbatim); free(language); free(top); + CHECKED_FOPEN(yyout, output_file_name, "w"); + return 0; }