Compare commits

..

1 Commits

Author SHA1 Message Date
3a7f09bb49 fixed file_close bug when file is NULL 2025-11-21 21:21:02 +05:00

View File

@@ -59,6 +59,8 @@ str path_basename(str path, bool remove_ext);
Result(FILE*) file_open(cstr file_name, cstr fopen_mode); Result(FILE*) file_open(cstr file_name, cstr fopen_mode);
static inline void file_close(FILE* f){ static inline void file_close(FILE* f){
if(f == NULL)
return;
fclose(f); fclose(f);
} }