#include #include "aplinks.h" int free_sector(unsigned char *fat_buffer[], unsigned char *dir_buffer[], unsigned char *data_buffer[], FAT_RANGE fat_range, DIR_RANGE dir_range, DATA_RANGE data_range) { int i; for(i = 0; i <= fat_range.end; i++){ if(fat_buffer[i] != NULL){ free(fat_buffer[i]); } } for(i = dir_range.start; i <= dir_range.end; i++){ if(dir_buffer[i - dir_range.start] != NULL){ free(dir_buffer[i - dir_range.start]); } } for(i = data_range.start; i <= data_range.end; i++){ if(data_buffer[i - data_range.start] != NULL){ free(data_buffer[i - data_range.start]); } } return 0; }