=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- src/usr.bin/tmux/screen-write.c 2017/04/25 18:30:29 1.118 +++ src/usr.bin/tmux/screen-write.c 2017/04/29 21:27:46 1.119 @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.118 2017/04/25 18:30:29 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.119 2017/04/29 21:27:46 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1316,12 +1316,12 @@ fatalx("UTF-8 data empty"); /* Retrieve the previous cell. */ - for (n = 1; n < s->cx; n++) { + for (n = 1; n <= s->cx; n++) { grid_view_get_cell(gd, s->cx - n, s->cy, &gc); if (~gc.flags & GRID_FLAG_PADDING) break; } - if (n == s->cx) + if (n > s->cx) return (NULL); *xx = s->cx - n;