diff --git a/src/screen_text.c b/src/screen_text.c
index 244903dd85a8645b0e05797f07a56c8eacc84d14..938d65627d69a2f63e1857d01656312dd3f7e3c1 100644 (file)
--- a/src/screen_text.c
+++ b/src/screen_text.c
}
void
-screen_text_set(struct screen_text *text, const char *str)
+screen_text_append(struct screen_text *text, const char *str)
{
- const char *eol, *next;
-
assert(str != NULL);
- screen_text_clear(text);
-
+ const char *eol;
while ((eol = strchr(str, '\n')) != NULL) {
char *line;
- next = eol + 1;
+ const char *next = eol + 1;
/* strip whitespace at end */
screen_text_list_callback(unsigned idx, void *data)
{
const struct screen_text *text = data;
- static char buffer[256];
- char *value;
assert(idx < text->lines->len);
- value = utf8_to_locale(g_ptr_array_index(text->lines, idx));
+ char *value = utf8_to_locale(g_ptr_array_index(text->lines, idx));
+
+ static char buffer[256];
g_strlcpy(buffer, value, sizeof(buffer));
g_free(value);
bool
screen_text_cmd(struct screen_text *text,
- G_GNUC_UNUSED struct mpdclient *c, command_t cmd)
+ gcc_unused struct mpdclient *c, command_t cmd)
{
if (list_window_scroll_cmd(text->lw, cmd)) {
screen_text_repaint(text);