From 86f5550e60cf2be42e03b29a22cd0ba77f5d72b4 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 8 Dec 2023 09:38:51 +0100 Subject: [PATCH] [fdb] close stream pointer via fclose() (#268) Co-authored-by: Oleg Hahm --- src/fdb_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fdb_file.c b/src/fdb_file.c index 1c99a38..0226122 100644 --- a/src/fdb_file.c +++ b/src/fdb_file.c @@ -210,7 +210,7 @@ static void update_file_cache(fdb_db_t db, uint32_t sec_addr, FILE *fd) else { /* cache is full, move to end */ for (int i = FDB_FILE_CACHE_TABLE_SIZE - 1; i > 0; i--) { - close(db->cur_file[i]); + fclose(db->cur_file[i]); memcpy(&db->cur_file[i], &db->cur_file[i - 1], sizeof(db->cur_file[0])); memcpy(&db->cur_file_sec[i], &db->cur_file_sec[i - 1], sizeof(db->cur_file_sec[0])); }