summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2014-03-31 21:43:36 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2014-03-31 21:43:36 +0000
commit0468e52a4d27234bbc3fd8a2907e248fa8846b92 (patch)
tree43a2997a7d59636672fa645239a16bb94b4ebed0 /usr.bin
parentaa9ec52e81d266c24a7a8c4c923d78ddadde5019 (diff)
In four byte UTF-8 sequences, only three bits of the first byte should
be used. Fix from Koga Osamu.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c
index 80f6593c3eb..2e673d4e44d 100644
--- a/usr.bin/tmux/utf8.c
+++ b/usr.bin/tmux/utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utf8.c,v 1.7 2013/04/12 12:50:36 nicm Exp $ */
+/* $OpenBSD: utf8.c,v 1.8 2014/03/31 21:43:35 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -311,7 +311,7 @@ utf8_combine(const struct utf8_data *utf8data)
value = utf8data->data[3] & 0x3f;
value |= (utf8data->data[2] & 0x3f) << 6;
value |= (utf8data->data[1] & 0x3f) << 12;
- value |= (utf8data->data[0] & 0x3f) << 18;
+ value |= (utf8data->data[0] & 0x07) << 18;
break;
}
return (value);