forked from len0rd/rockbox
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
This commit is contained in:
parent
c2900a1bac
commit
3d4701a6e4
83 changed files with 271 additions and 271 deletions
|
@ -86,7 +86,7 @@ void traversedir(char* location, char* name)
|
|||
/* check if path is removed directory, if so dont enter it */
|
||||
rb->snprintf(path, MAX_PATH, "%s/%s", fullpath, entry->d_name);
|
||||
while(path[0] == '/')
|
||||
rb->strncpy(path, path + 1, rb->strlen(path));
|
||||
rb->strlcpy(path, path + 1, sizeof(path));
|
||||
for(i = 0; i < num_replaced_dirs; i++)
|
||||
{
|
||||
if(!rb->strcmp(path, removed_dirs[i]))
|
||||
|
@ -141,8 +141,8 @@ bool custom_dir(void)
|
|||
(num_replaced_dirs < MAX_REMOVED_DIRS))
|
||||
{
|
||||
num_replaced_dirs ++;
|
||||
rb->strncpy(removed_dirs[num_replaced_dirs - 1], line + 2,
|
||||
rb->strlen(line));
|
||||
rb->strlcpy(removed_dirs[num_replaced_dirs - 1], line + 2,
|
||||
sizeof(line));
|
||||
}
|
||||
}
|
||||
rb->close(fd2);
|
||||
|
@ -157,7 +157,7 @@ bool custom_dir(void)
|
|||
{
|
||||
/* remove preceeding '/'s from the line */
|
||||
while(line[0] == '/')
|
||||
rb->strncpy(line, line + 1, rb->strlen(line));
|
||||
rb->strlcpy(line, line + 1, sizeof(line));
|
||||
|
||||
rb->snprintf(formatted_line, MAX_PATH, "/%s", line);
|
||||
|
||||
|
@ -237,7 +237,7 @@ void generate(void)
|
|||
char *list_get_name_cb(int selected_item, void* data, char* buf, size_t buf_len)
|
||||
{
|
||||
(void)data;
|
||||
rb->strncpy(buf, list->folder[selected_item], buf_len);
|
||||
rb->strlcpy(buf, list->folder[selected_item], buf_len);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue