summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 3cd40deb45..ce812c7c67 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -111,18 +111,21 @@ int playlist_first_index(void)
111 return playlist.first_index; 111 return playlist.first_index;
112} 112}
113 113
114void playlist_name(char *name, int name_size) 114char *playlist_name(char *buf, int buf_size)
115{ 115{
116 char buf[MAX_PATH+1]; 116 char *sep;
117 int i = 0; 117
118 snprintf(buf, buf_size, "%s", playlist.filename+playlist.dirlen);
118 119
119 snprintf(buf, sizeof(buf), "%s", playlist.filename+playlist.dirlen); 120 if (0 == buf[0])
120 while((buf[i] != '.') && (buf[i] != 0)) 121 return NULL;
121 i++;
122 buf[i] = 0;
123 122
124 snprintf(name, name_size, "%s", buf); 123 /* Remove extension */
125 return; 124 sep = strrchr(buf, '.');
125 if (NULL != sep)
126 *sep = 0;
127
128 return buf;
126} 129}
127 130
128int playlist_next(int steps) 131int playlist_next(int steps)