From ef202f6b0e41caa67d4574f925cbdeb59c623493 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 23 Aug 2012 12:00:26 +0000 Subject: Fixed bug 3560980. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4617 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'demos/ARMCM3-STM32F103ZG-FATFS') diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index fe85ac1aa..28bd21d3a 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -121,6 +121,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); @@ -137,7 +141,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); -- cgit v1.2.3