From 520520e576b052645226c1ed3f5c1ea836c68be5 Mon Sep 17 00:00:00 2001 From: SirTalksalot75 <132705706+SirTalksalot75@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:27:11 +0200 Subject: [PATCH] Update main.c moved atexit() to setup --- src/main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main.c b/src/main.c index dd9dde2..db22990 100644 --- a/src/main.c +++ b/src/main.c @@ -13,6 +13,16 @@ void notify_exit(void) DEBUG("Exiting gemstone..."); } +/** + * @brief Closes File after compiling. + * + */ + +void close_file(char file_to_close) +{ + fclose(file_to_close); +} + /** * @brief Run compiler setup here * @@ -31,27 +41,17 @@ void setup(void) // actual setup DEBUG("finished starting up gemstone..."); -} - -/** - * @brief Closes File after compiling. - * - */ - -void close_file(char file_to_close) -{ - fclose(file_to_close); + atexit(close_file(filename)); } int main(int argc, char *argv[]) { setup(); - atexit(close_file(filename); // Check for file input as argument if (2 != argc) { - printf("Usage: %s \n", argv[0]); + INFO("Usage: %s \n", argv[0]); PANIC("No File could be found"); }