fs:fat: fix set file name function
authorPiotr Wilczek <p.wilczek@samsung.com>
Fri, 11 Oct 2013 13:43:33 +0000 (15:43 +0200)
committerTom Rini <trini@ti.com>
Fri, 8 Nov 2013 20:25:13 +0000 (15:25 -0500)
Curently memcpy copies string without null terminating char because
function strlen returns only number of characters excluding
null terminating character. Replace memcpy with strcpy.

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Tom Rini <trini@ti.com>
fs/fat/fat_write.c

index b7a21e0..9f5e911 100644 (file)
@@ -57,7 +57,7 @@ static void set_name(dir_entry *dirent, const char *filename)
        if (len == 0)
                return;
 
-       memcpy(s_name, filename, len);
+       strcpy(s_name, filename);
        uppercase(s_name, len);
 
        period = strchr(s_name, '.');