aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c')
-rw-r--r--demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c b/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c
index e22710174..09a6ae3a6 100644
--- a/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c
+++ b/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c
@@ -125,6 +125,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) {
int i;
char *fn;
+#if _USE_LFN
+ fno.lfname = 0;
+ fno.lfsize = 0;
+#endif
res = f_opendir(&dir, path);
if (res == FR_OK) {
i = strlen(path);
@@ -141,7 +145,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) {
res = scan_files(chp, path);
if (res != FR_OK)
break;
- path[i] = 0;
+ path[--i] = 0;
}
else {
chprintf(chp, "%s/%s\r\n", path, fn);