summaryrefslogtreecommitdiffstats
path: root/apps/plugins/properties.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-04-09 15:25:17 +0000
committerNils Wallménius <nils@rockbox.org>2008-04-09 15:25:17 +0000
commit6848961aa5f93a290917071ff3496e1d5026621b (patch)
tree70d377348ab0694c356fffd9fe25f095ccbe88fe /apps/plugins/properties.c
parentae64d2602befd5589c8c0141a6d812841fdfb232 (diff)
downloadrockbox-6848961aa5f93a290917071ff3496e1d5026621b.tar.gz
rockbox-6848961aa5f93a290917071ff3496e1d5026621b.tar.bz2
rockbox-6848961aa5f93a290917071ff3496e1d5026621b.zip
Pass the buffer length to the list_get_name callback functions instead of using hardcoded MAX_PATH
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17049 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/properties.c')
-rw-r--r--apps/plugins/properties.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 8b1f6ee636..27805154b3 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -214,38 +214,39 @@ static bool dir_properties(char* selected_file)
return true;
}
-char * get_props(int selected_item, void* data, char *buffer)
+char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len)
{
(void)data;
switch(selected_item)
{
case 0:
- rb->strcpy(buffer, str_dirname);
+ rb->strncpy(buffer, str_dirname, buffer_len);
break;
case 1:
- rb->strcpy(buffer, its_a_dir ? str_dircount : str_filename);
+ rb->strncpy(buffer, its_a_dir ? str_dircount : str_filename,
+ buffer_len);
break;
case 2:
- rb->strcpy(buffer, its_a_dir ? str_filecount : str_size);
+ rb->strncpy(buffer, its_a_dir ? str_filecount : str_size, buffer_len);
break;
case 3:
- rb->strcpy(buffer, its_a_dir ? str_size : str_date);
+ rb->strncpy(buffer, its_a_dir ? str_size : str_date, buffer_len);
break;
case 4:
- rb->strcpy(buffer, its_a_dir ? "" : str_time);
+ rb->strncpy(buffer, its_a_dir ? "" : str_time, buffer_len);
break;
case 5:
- rb->strcpy(buffer, its_a_dir ? "" : str_artist);
+ rb->strncpy(buffer, its_a_dir ? "" : str_artist, buffer_len);
break;
case 6:
- rb->strcpy(buffer, its_a_dir ? "" : str_title);
+ rb->strncpy(buffer, its_a_dir ? "" : str_title, buffer_len);
break;
case 7:
- rb->strcpy(buffer, its_a_dir ? "" : str_album);
+ rb->strncpy(buffer, its_a_dir ? "" : str_album, buffer_len);
break;
default:
- rb->strcpy(buffer, "ERROR");
+ rb->strncpy(buffer, "ERROR", buffer_len);
break;
}
return buffer;