summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-28 21:58:43 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-28 21:58:43 +0200
commita1146a1ce3983d05fed52d7a763e79856dcc6f9b (patch)
treecaa28d897f1c183b03efc5f577c53c02bb162616 /playlist.c
parent4c41a6c6c9accea5854755bbb0f1a3476d31f8b2 (diff)
changed pl_find_meta behavior to return NULL for not-found items
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index 5ee1a818..4d4a09a1 100644
--- a/playlist.c
+++ b/playlist.c
@@ -864,6 +864,12 @@ void
pl_format_item_display_name (playItem_t *it, char *str, int len) {
const char *artist = pl_find_meta (it, "artist");
const char *title = pl_find_meta (it, "title");
+ if (!artist) {
+ artist = "Unknown artist";
+ }
+ if (!title) {
+ title = "Unknown title";
+ }
snprintf (str, len, "%s - %s", artist, title);
#if 0
// artist - title
@@ -920,7 +926,7 @@ pl_find_meta (playItem_t *it, const char *key) {
}
m = m->next;
}
- return "?";
+ return NULL;
}
void