int color;
char *msg;
va_list ap;
+ unsigned bytes;
if (ll < loglevel || !curses_active)
return;
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);
}