From 3d4701a6e41616cf581a297bab1451cf2db70249 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 14 Jul 2009 13:57:45 +0000 Subject: 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 --- apps/plugins/random_folder_advance_config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/plugins/random_folder_advance_config.c') diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index 28546a340c..c9ffaed319 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c @@ -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; } -- cgit v1.2.3