summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-04-29 21:27:46 +0000
committernicm <nicm@openbsd.org>2017-04-29 21:27:46 +0000
commit5047bf93f90f790d8f5e628fdaee04f5dffc3f3a (patch)
tree61f7627ef892a21b12f7a59ec98eb126f7d36183
parentReplace sxiehci.c with more generic glue in ehci_fdt.c that is similiar in (diff)
downloadwireguard-openbsd-5047bf93f90f790d8f5e628fdaee04f5dffc3f3a.tar.xz
wireguard-openbsd-5047bf93f90f790d8f5e628fdaee04f5dffc3f3a.zip
Fix UTF-8 combining characters in column 0, based on a diff from Keith
Winstein.
-rw-r--r--usr.bin/tmux/screen-write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index c1599c36fb9..8fac027675e 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -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 <nicholas.marriott@gmail.com>
@@ -1316,12 +1316,12 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct utf8_data *ud,
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;