diff --git a/source/fs.c b/source/fs.c index c71de7a..d039c3c 100644 --- a/source/fs.c +++ b/source/fs.c @@ -377,7 +377,7 @@ renamed: sprintf(path_to_file, "%s%s", main_paths[mode], filename); // filter out characters illegal in FAT32 filenames - char * curr_filename = strrchr(path_to_file, '/') + 1; + char * curr_filename = path_to_file + strlen(main_paths[mode]); char * illegal_char = curr_filename; while ((illegal_char = strpbrk(illegal_char, ILLEGAL_CHARS))) {