diff --git a/src/screen_browser.c b/src/screen_browser.c
index 66727611d0901a41ef0ba71d0b765ab56863ab62..04673f4e85a7e5632525a3cf19820fcab1d80ad6 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
#define HIGHLIGHT (0x01)
#endif
-static const char playlist_format[] = "*%s*";
-
#ifndef NCMPC_MINI
/* sync highlight flags with playlist */
mpd_entity_get_playlist(entity);
char *filename = utf8_to_locale(g_basename(mpd_playlist_get_path(playlist)));
- g_snprintf(buf, BUFSIZE, playlist_format, filename);
+ g_strlcpy(buf, filename, sizeof(buf));
g_free(filename);
return buf;
}
enqueue_and_play(struct mpdclient *c, struct filelist_entry *entry)
{
struct mpd_connection *connection = mpdclient_get_connection(c);
+ if (connection == NULL)
+ return false;
+
const struct mpd_song *song = mpd_entity_get_song(entry->entity);
int id;