Skip to content

Commit

Permalink
[fdb] close stream pointer via fclose() (#268)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleg Hahm <oleg@riot-os.org>
  • Loading branch information
OlegHahm and OlegHahm authored Dec 8, 2023
1 parent c1226f3 commit 86f5550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fdb_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
}
Expand Down

0 comments on commit 86f5550

Please sign in to comment.