From 5eb7b6f431aa821684c7208d9a42779ba7002bec Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 22 Oct 2023 18:03:05 +0100 Subject: Fix bug where FILE is closed when passing to darr_(write|read) --- src/darr.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/darr.c b/src/darr.c index e9e4ca5..4393c4b 100644 --- a/src/darr.c +++ b/src/darr.c @@ -61,7 +61,6 @@ byte darr_at(darr_t *darr, size_t index) void darr_write_file(darr_t *bytes, FILE *fp) { size_t size = fwrite(bytes->data, bytes->used, 1, fp); - fclose(fp); assert(size == 1); } @@ -73,7 +72,6 @@ darr_t darr_read_file(FILE *fp) darr_init(&darr, size); fseek(fp, 0, SEEK_SET); size_t read = fread(darr.data, size, 1, fp); - fclose(fp); assert(read == 1); return darr; } -- cgit v1.2.3-13-gbd6f