]> 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 a6bc54a738ff5e255675fbbe9902d09afabc281f..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);
 }