Update main.c

fixed typo, and changed close_file function
This commit is contained in:
SirTalksalot75 2024-04-23 14:38:30 +02:00 committed by GitHub
parent dad9cbb93a
commit fafcb942e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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[]) { int main(int argc, char *argv[]) {
setup(); setup();
atexit(close_file); atexit(close_file(filename);
// Check for file input as argument // Check for file input as argument
if (2 != argc) if (2 != argc)