From 482dd1b82fcaf2128da09ece221fc220eea51e6b Mon Sep 17 00:00:00 2001 From: Sattvik Date: Tue, 17 Feb 2009 22:42:08 -0700 Subject: [PATCH] Null mpd variables should have an empty string patch sf.net id #2564747. --- ChangeLog | 1 + src/mpd.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 22f3eddd..f97ca1be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ * Extended support for local Maildir patch sf.net id #2561323 (thanks Nicolas) * XMMS2 fix and refactoring patch sf.net id #2579357 (thanks Tamim) + * Null mpd variables should have an empty string patch sf.net id #2564747 2009-02-15 * Added out_to_x diff --git a/src/mpd.c b/src/mpd.c index d55fe05e..06a02bd1 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -129,6 +129,7 @@ static void *update_mpd_thread(void *arg) mpd_Status *status; mpd_InfoEntity *entity; timed_thread *me = *(timed_thread **)arg; + const char *emptystr = ""; while (1) { clear_mpd(); @@ -247,7 +248,7 @@ static void *update_mpd_thread(void *arg) mpd_freeInfoEntity(entity); continue; } -#define SONGSET(x) if(song->x) mpd_info.x = strmdup(song->x) +#define SONGSET(x) if(song->x) mpd_info.x = strmdup(song->x); else mpd_info.x = strmdup(emptystr) SONGSET(artist); SONGSET(album); SONGSET(title);