summaryrefslogtreecommitdiffstats
path: root/apps/playlist_viewer.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/playlist_viewer.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/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index c34957b332..9483dadfab 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -544,11 +544,14 @@ static int get_track_num( struct playlist_viewer * local_viewer,
return selected_item;
}
-static char *playlist_callback_name(int selected_item, void *data, char *buffer)
+static char *playlist_callback_name(int selected_item,
+ void *data,
+ char *buffer,
+ size_t buffer_len)
{
struct playlist_viewer * local_viewer = (struct playlist_viewer *)data;
struct playlist_entry *track = playlist_buffer_get_track(&(local_viewer->buffer), get_track_num(local_viewer,selected_item));
- format_line(track, buffer, MAX_PATH);
+ format_line(track, buffer, buffer_len);
return(buffer);
}
@@ -752,12 +755,14 @@ exit:
return ret;
}
-static char *playlist_search_callback_name(int selected_item, void * data, char *buffer)
+static char *playlist_search_callback_name(int selected_item, void * data,
+ char *buffer, size_t buffer_len)
{
+ (void)buffer_len; /* this should probably be used */
int *found_indicies = (int*)data;
static struct playlist_track_info track;
- playlist_get_track_info(viewer.playlist,found_indicies[selected_item],&track);
- format_name(buffer,track.filename);
+ playlist_get_track_info(viewer.playlist, found_indicies[selected_item], &track);
+ format_name(buffer, track.filename);
return(buffer);
}