Code

main: check for strfsong() failure, add fallback
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 16:04:21 +0000 (17:04 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 16:04:21 +0000 (17:04 +0100)
src/main.c

index b67165f144f9eec225a338285ed9c96dcafe6cfd..72a9362e53e2cee8f3766484e32a9739765b1dfc 100644 (file)
@@ -78,6 +78,9 @@ update_xterm_title(void)
        if (options.xterm_title_format && mpd->playing && song)
                strfsong(tmp, BUFSIZE, options.xterm_title_format, song);
        else
+               *tmp = 0;
+
+       if (*tmp == 0)
                g_strlcpy(tmp, PACKAGE " version " VERSION, BUFSIZE);
 
        static char title[BUFSIZE];