From 4590a4995424e9dbd79bf0761490c53ce8064b8c Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 5 Jan 2024 20:32:11 -0800 Subject: add some documentation --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9fd2eee..7ffdccd 100644 --- a/main.c +++ b/main.c @@ -33,8 +33,12 @@ int main(int argc, char **argv) { version(); } - FILE *fp = fopen(argv[1], "rb"); - ssize_t bytes_read = getdelim(&INBUF, &len, '\0', fp); + FILE *FP = fopen(argv[1], "rb"); + ssize_t bytes_read = getdelim(&INBUF, &len, '\0', FP); + if (FP != NULL) { + fflush(FP); + fclose(FP); + } PARSER = init_parser(INBUF); STACK = init_array(10); -- cgit