Code

mpdclient: allow song id 0
authorMax Kellermann <max@duempel.org>
Sat, 14 Nov 2009 01:55:10 +0000 (02:55 +0100)
committerMax Kellermann <max@duempel.org>
Sat, 14 Nov 2009 01:55:10 +0000 (02:55 +0100)
Off-by-one bug.  Change ">" to ">=".

src/mpdclient.c

index ca7a7b61ba2352d53b47b889d0f14914b38c000e..e53e58cf43176dbfff10a5e23ef6f65220f1a350 100644 (file)
@@ -229,7 +229,7 @@ mpdclient_update(struct mpdclient *c)
        }
 
        /* update the current song */
-       if (!c->song || mpd_status_get_song_id(c->status)) {
+       if (!c->song || mpd_status_get_song_id(c->status) >= 0) {
                c->song = playlist_get_song(&c->playlist,
                                            mpd_status_get_song_pos(c->status));
        }