]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui.c
Remove chop().
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index 284de0cb7778444c2b6936eb6c8d8a765370070e..96132589157ab83810da14e3f96e768d80f518ae 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -519,6 +519,7 @@ static __printf_2_3 void curses_log(int ll, const char *fmt,...)
        int color;
        char *msg;
        va_list ap;
+       unsigned bytes;
 
        if (ll < loglevel || !curses_active)
                return;
@@ -532,9 +533,10 @@ static __printf_2_3 void curses_log(int ll, const char *fmt,...)
                        color = COLOR_ERRMSG;
        }
        va_start(ap, fmt);
-       xvasprintf(&msg, fmt, ap);
+       bytes = xvasprintf(&msg, fmt, ap);
        va_end(ap);
-       chop(msg);
+       if (bytes > 0 && msg[bytes - 1] == '\n')
+               msg[bytes - 1] = '\0'; /* cut trailing newline */
        rb_add_entry(color, msg);
        wrefresh(bot.win);
 }
@@ -593,8 +595,6 @@ __noreturn __printf_2_3 static void msg_n_exit(int ret, const char* fmt, ...)
  */
 static void init_wins(int top_lines)
 {
-       int i;
-
        top.lines = top_lines;
        top.cols = COLS;
        top.begy = 0;
@@ -663,8 +663,7 @@ static void init_wins(int top_lines)
                keypad(in.win, 1);
        }
        wmove(sep.win, 0, 0);
-       for (i = 1; i <= COLS; i++)
-               waddstr(sep.win, theme.sep_str);
+       whline(sep.win, theme.sep_char, COLS);
        wclear(top.win);
        //wclear(bot.win);
        wnoutrefresh(top.win);