diff --git a/src/screen_text.c b/src/screen_text.c
index 44fe492e9ca0a6c16fbad7ab662ed81333f1a629..938d65627d69a2f63e1857d01656312dd3f7e3c1 100644 (file)
--- a/src/screen_text.c
+++ b/src/screen_text.c
void
screen_text_append(struct screen_text *text, const char *str)
{
- const char *eol, *next;
-
assert(str != NULL);
+ 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);