From 8e30b39448806862ab907f7173ccf0fb76379815 Mon Sep 17 00:00:00 2001 From: Kaian Date: Tue, 23 Aug 2022 14:06:49 +0200 Subject: [PATCH] ui: fix raw payload new line print logic #410 --- src/curses/ui_manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/curses/ui_manager.c b/src/curses/ui_manager.c index 3b07d82..15a89d1 100644 --- a/src/curses/ui_manager.c +++ b/src/curses/ui_manager.c @@ -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]);