]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
gui: Replace also \r and \f by spaces.
authorAndre Noll <maan@systemlinux.org>
Sun, 4 Jul 2010 21:17:41 +0000 (23:17 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 Jul 2010 21:17:41 +0000 (23:17 +0200)
id3 comments might contain these characters which can mess up the curses output.

gui.c

diff --git a/gui.c b/gui.c
index dbe0a19ced1d1da9e2d588a2498dfc931371ee65..865ed658afc4197f4ba29ce5344be38fcbd48bad 100644 (file)
--- 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;
        }
                str[len] = '\0';
                num = 0;
        }
-       /* replace newlines by spaces */
+       /* replace control characters by spaces */
        for (i = 0; i < len && str[i]; i++) {
        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) {
                        str[i] = ' ';
        }
        if (align == LEFT) {