Skip to content

Commit

Permalink
ui: fix raw payload new line print logic #410
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed Aug 23, 2022
1 parent 3d590fe commit 8e30b39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/curses/ui_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 8e30b39

Please sign in to comment.