aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2024-01-05 20:32:11 -0800
committerPreston Pan <preston@nullring.xyz>2024-01-05 20:32:11 -0800
commit4590a4995424e9dbd79bf0761490c53ce8064b8c (patch)
tree15187a9a4a0c188add0b8af32ef5a19431da7ad3 /main.c
parent77262bf18c407e04b926a0efbea09b31c672f374 (diff)
add some documentation
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
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);