diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |