summaryrefslogtreecommitdiff
path: root/apps/plugins/random_folder_advance_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/random_folder_advance_config.c')
-rw-r--r--apps/plugins/random_folder_advance_config.c10
1 files changed, 5 insertions, 5 deletions
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)
86 /* check if path is removed directory, if so dont enter it */ 86 /* check if path is removed directory, if so dont enter it */
87 rb->snprintf(path, MAX_PATH, "%s/%s", fullpath, entry->d_name); 87 rb->snprintf(path, MAX_PATH, "%s/%s", fullpath, entry->d_name);
88 while(path[0] == '/') 88 while(path[0] == '/')
89 rb->strncpy(path, path + 1, rb->strlen(path)); 89 rb->strlcpy(path, path + 1, sizeof(path));
90 for(i = 0; i < num_replaced_dirs; i++) 90 for(i = 0; i < num_replaced_dirs; i++)
91 { 91 {
92 if(!rb->strcmp(path, removed_dirs[i])) 92 if(!rb->strcmp(path, removed_dirs[i]))
@@ -141,8 +141,8 @@ bool custom_dir(void)
141 (num_replaced_dirs < MAX_REMOVED_DIRS)) 141 (num_replaced_dirs < MAX_REMOVED_DIRS))
142 { 142 {
143 num_replaced_dirs ++; 143 num_replaced_dirs ++;
144 rb->strncpy(removed_dirs[num_replaced_dirs - 1], line + 2, 144 rb->strlcpy(removed_dirs[num_replaced_dirs - 1], line + 2,
145 rb->strlen(line)); 145 sizeof(line));
146 } 146 }
147 } 147 }
148 rb->close(fd2); 148 rb->close(fd2);
@@ -157,7 +157,7 @@ bool custom_dir(void)
157 { 157 {
158 /* remove preceeding '/'s from the line */ 158 /* remove preceeding '/'s from the line */
159 while(line[0] == '/') 159 while(line[0] == '/')
160 rb->strncpy(line, line + 1, rb->strlen(line)); 160 rb->strlcpy(line, line + 1, sizeof(line));
161 161
162 rb->snprintf(formatted_line, MAX_PATH, "/%s", line); 162 rb->snprintf(formatted_line, MAX_PATH, "/%s", line);
163 163
@@ -237,7 +237,7 @@ void generate(void)
237char *list_get_name_cb(int selected_item, void* data, char* buf, size_t buf_len) 237char *list_get_name_cb(int selected_item, void* data, char* buf, size_t buf_len)
238{ 238{
239 (void)data; 239 (void)data;
240 rb->strncpy(buf, list->folder[selected_item], buf_len); 240 rb->strlcpy(buf, list->folder[selected_item], buf_len);
241 return buf; 241 return buf;
242} 242}
243 243