From bf40373099df7fcf96a0fcb0d6d0bc081c6d3371 Mon Sep 17 00:00:00 2001 From: Donggeun Kim Date: Fri, 24 Dec 2010 13:45:02 +0900 Subject: [PATCH] fat: fix setting wrong short file name having no extenstion Signed-off-by: Donggeun Kim --- fs/fat/fat_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index ca1b1fb..bc6358c 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -85,7 +85,7 @@ static void set_name (dir_entry *dirent, const char *filename) period = strchr(s_name, '.'); if (period == NULL) { - period_location = len - 1; + period_location = len; ext_num = 0; } else { period_location = period - s_name; @@ -108,7 +108,7 @@ static void set_name (dir_entry *dirent, const char *filename) if (ext_num < 3) { memcpy(dirent->ext, s_name + period_location + 1, ext_num); for (i = ext_num; i < 3; i++) - dirent->name[i] = ' '; + dirent->ext[i] = ' '; } else memcpy(dirent->ext, s_name + period_location + 1, 3); -- 2.7.4