X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=gui.c;h=96132589157ab83810da14e3f96e768d80f518ae;hb=efbb7fcd1fc143a046cfa4b44dbb527b248e110b;hp=a6bc54a738ff5e255675fbbe9902d09afabc281f;hpb=3d9df3244a04aaf5c0c216f2e475f5355cf9721b;p=paraslash.git diff --git a/gui.c b/gui.c index a6bc54a7..96132589 100644 --- 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); }