summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
committerNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
commit3d4701a6e41616cf581a297bab1451cf2db70249 (patch)
treef845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /firmware/drivers/fat.c
parentc2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff)
downloadrockbox-3d4701a6e41616cf581a297bab1451cf2db70249.tar.gz
rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.zip
FS#10080
* Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c4
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