- for (i = screen->scroll_y; i < max_y; i++)
- mvwaddnstr(screen->scr.sub_ncw, i, 1, screen->lines[i], max_x);
+ for (i = screen->scroll_y; i < max_y; i++) {
+ len = strncols(screen->lines[i]) > max_x ? max_x : -1;
+ mvwaddnstr(screen->scr.sub_ncw, i, 1, screen->lines[i], len);
+ }