ui: fix raw payload new line print logic #410

This commit is contained in:
Kaian 2022-08-23 14:06:49 +02:00
parent 3d590febcd
commit 8e30b39448
1 changed files with 5 additions and 2 deletions

View File

@ -448,12 +448,15 @@ draw_message_pos(WINDOW *win, sip_msg_t *msg, int starting)
cur_line =payload + i + 1;
// Move to the next line if line is filled or a we reach a line break
if (column > width || payload[i] == '\n') {
if (column > width - 1 || payload[i] == '\n') {
line++;
column = 0;
continue;
}
// No need to print new line characters
if (payload[i] == '\n')
continue;
// Put next character in position
if (isascii(payload[i])) {
mvwaddch(win, line, column++, payload[i]);