From fafcb942e02c8967c47cd7f88c9114463701e2d9 Mon Sep 17 00:00:00 2001 From: SirTalksalot75 <132705706+SirTalksalot75@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:38:30 +0200 Subject: [PATCH] Update main.c fixed typo, and changed close_file function --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index bbcf14b..dd9dde2 100644 --- a/src/main.c +++ b/src/main.c @@ -38,15 +38,15 @@ void setup(void) * */ -void close_file(void) +void close_file(char file_to_close) { - fclose(argv[1]); + fclose(file_to_close); } int main(int argc, char *argv[]) { setup(); - atexit(close_file); + atexit(close_file(filename); // Check for file input as argument if (2 != argc)