summaryrefslogtreecommitdiffstats
path: root/apps/cuesheet.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/cuesheet.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/cuesheet.c')
-rw-r--r--apps/cuesheet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index de5a258ca8..ba6bc9659d 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -266,16 +266,17 @@ int cue_find_current_track(struct cuesheet *cue, unsigned long curpos)
/* callback that gives list item titles for the cuesheet browser */
static char *list_get_name_cb(int selected_item,
- void *data,
- char *buffer)
+ void *data,
+ char *buffer,
+ size_t buffer_len)
{
struct cuesheet *cue = (struct cuesheet *)data;
if (selected_item & 1)
- snprintf(buffer, MAX_PATH, "%s",
+ snprintf(buffer, buffer_len, "%s",
cue->tracks[selected_item/2].title);
else
- snprintf(buffer, MAX_PATH, "%02d. %s", selected_item/2+1,
+ snprintf(buffer, buffer_len, "%02d. %s", selected_item/2+1,
cue->tracks[selected_item/2].performer);
return buffer;