From 73d23e6bddcc4d1b6d46a31307ca56f586b541ad Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 4 Jul 2010 23:17:41 +0200 Subject: [PATCH] gui: Replace also \r and \f by spaces. id3 comments might contain these characters which can mess up the curses output. --- gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui.c b/gui.c index dbe0a19c..865ed658 100644 --- a/gui.c +++ b/gui.c @@ -294,9 +294,9 @@ static int align_str(WINDOW* win, char *str, unsigned int len, str[len] = '\0'; num = 0; } - /* replace newlines by spaces */ + /* replace control characters by spaces */ for (i = 0; i < len && str[i]; i++) { - if (str[i] == '\n') + if (str[i] == '\n' || str[i] == '\r' || str[i] == '\f') str[i] = ' '; } if (align == LEFT) { -- 2.39.2