Code

README.rst: reformat the "Links" section
[ncmpc.git] / src / screen_song.c
index 555490ea7a7d99545a9e0d6f8c60072ae5eedc05..d7b6d2c51d5b4feb7e52be03d6d39f67bb838064 100644 (file)
@@ -25,7 +25,7 @@
 #include "i18n.h"
 #include "screen.h"
 #include "charset.h"
-#include "utils.h"
+#include "time_format.h"
 #include "mpdclient.h"
 
 #include <mpd/client.h>
@@ -122,7 +122,7 @@ screen_song_list_callback(unsigned idx, gcc_unused void *data)
 
 
 static void
-screen_song_init(WINDOW *w, int cols, int rows)
+screen_song_init(WINDOW *w, unsigned cols, unsigned rows)
 {
        for (unsigned i = 0; i < G_N_ELEMENTS(tag_labels); ++i) {
                if (tag_labels[i] != NULL) {
@@ -160,7 +160,7 @@ screen_song_exit(void)
 }
 
 static void
-screen_song_resize(int cols, int rows)
+screen_song_resize(unsigned cols, unsigned rows)
 {
        list_window_resize(lw, cols, rows);
 }
@@ -213,9 +213,12 @@ screen_song_append(const char *label, const char *value, unsigned label_col)
 
                char *p = g_strdup(value_iter);
                unsigned width = utf8_cut_width(p, value_col);
-               if (width == 0)
+               if (width == 0) {
                        /* not enough room for anything - bail out */
+                       g_free(entry);
+                       g_free(p);
                        break;
+               }
 
                *entry_iter = 0;