]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui.c
gui.c: Constify local variables of add_spaces().
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index 1421489013dfd56ef6f60bc427ee2e5ad0ae64da..6f688e0be6832c39dbcb5d620b2b6dfac96510c1 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -246,8 +246,8 @@ static char *km_keyname(int c)
 /* Print given number of spaces to curses window. */
 static void add_spaces(WINDOW* win, unsigned int num)
 {
-       char space[] = "                                ";
-       unsigned sz = sizeof(space) - 1; /* number of spaces */
+       const char space[] = "                                ";
+       const unsigned sz = sizeof(space) - 1; /* number of spaces */
 
        while (num >= sz)  {
                waddstr(win, space);
@@ -255,8 +255,7 @@ static void add_spaces(WINDOW* win, unsigned int num)
        }
        if (num > 0) {
                assert(num < sz);
-               space[num] = '\0';
-               waddstr(win, space);
+               waddstr(win, space + sz - num);
        }
 }