diff options
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r-- | firmware/drivers/fat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 2ff4c61ac4..a710593a69 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c | |||
@@ -1183,7 +1183,7 @@ static int write_long_name(struct fat_file* file, | |||
1183 | /* shortname entry */ | 1183 | /* shortname entry */ |
1184 | unsigned short date=0, time=0, tenth=0; | 1184 | unsigned short date=0, time=0, tenth=0; |
1185 | LDEBUGF("Shortname entry: %s\n", shortname); | 1185 | LDEBUGF("Shortname entry: %s\n", shortname); |
1186 | strncpy(entry + FATDIR_NAME, shortname, 11); | 1186 | memcpy(entry + FATDIR_NAME, shortname, 11); |
1187 | entry[FATDIR_ATTR] = is_directory?FAT_ATTR_DIRECTORY:0; | 1187 | entry[FATDIR_ATTR] = is_directory?FAT_ATTR_DIRECTORY:0; |
1188 | entry[FATDIR_NTRES] = 0; | 1188 | entry[FATDIR_NTRES] = 0; |
1189 | 1189 | ||
@@ -1271,7 +1271,7 @@ static int add_dir_entry(struct fat_dir* dir, | |||
1271 | /* The "." and ".." directory entries must not be long names */ | 1271 | /* The "." and ".." directory entries must not be long names */ |
1272 | if(dotdir) { | 1272 | if(dotdir) { |
1273 | int i; | 1273 | int i; |
1274 | strncpy(shortname, name, 12); | 1274 | strlcpy(shortname, name, 12); |
1275 | for(i = strlen(shortname); i < 12; i++) | 1275 | for(i = strlen(shortname); i < 12; i++) |
1276 | shortname[i] = ' '; | 1276 | shortname[i] = ' '; |
1277 | 1277 | ||