Code

lyrics: don't check current.lines==NULL
[ncmpc.git] / src / screen_lyrics.c
index 6853fecd72bb2a9dc494d2ca3fb435d1d51910e1..c2c7807235fd628c065ce186db429f250a2f5a11 100644 (file)
@@ -39,7 +39,6 @@
 #include <stdio.h>
 
 static list_window_t *lw = NULL;
-static int lyrics_text_rows = -1;
 
 static struct {
        const struct mpd_song *song;
@@ -208,8 +207,8 @@ static int store_lyr_hd(void)
 static const char *
 list_callback(unsigned idx, mpd_unused int *highlight, mpd_unused void *data)
 {
-       if (current.lines == NULL || idx >= current.lines->len)
-               return "";
+       if (idx >= current.lines->len)
+               return NULL;
 
        return g_ptr_array_index(current.lines, idx);
 }
@@ -324,7 +323,7 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
 
        lw->selected = lw->start+lw->rows;
        if (screen_find(screen,
-                       lw,  lyrics_text_rows,
+                       lw, current.lines->len,
                        cmd, list_callback, NULL)) {
                /* center the row */
                list_window_center(lw, current.lines->len, lw->selected);