diff --git a/sys/fs/fat/fat_filelib.c b/sys/fs/fat/fat_filelib.c index 07fe26c..e0afc9c 100644 --- a/sys/fs/fat/fat_filelib.c +++ b/sys/fs/fat/fat_filelib.c @@ -366,10 +366,13 @@ } kprintf("DB[%s:%i]\n", __FILE__, __LINE__); // Using dir cluster address search for filename - if (fatfs_get_file_entry(&_fs, file->parentcluster, file->filename,&sfEntry)) + if (fatfs_get_file_entry(&_fs, file->parentcluster, file->filename, + &sfEntry)) { + kprintf("DB[%s:%i]\n", __FILE__, __LINE__); // Make sure entry is file not dir! if (fatfs_entry_is_file(&sfEntry)) { + kprintf("DB[%s:%i]\n", __FILE__, __LINE__); // Initialise file details memcpy(file->shortfilename, sfEntry.Name, FAT_SFN_SIZE_FULL); file->filelength = FAT_HTONL(sfEntry.FileSize); @@ -389,6 +392,7 @@ return file; } + } kprintf("DB[%s:%i]\n", __FILE__, __LINE__); _free_file(file); return NULL;