Bugfix to fill_utf8() to make it actually work right

This commit is contained in:
Paul LeoNerd Evans 2008-02-10 18:12:19 +00:00
parent 9884031625
commit 516a1766a5
1 changed files with 3 additions and 2 deletions

View File

@ -301,8 +301,9 @@ static void fill_utf8(termkey_key *key)
// This is easier done backwards
int b = nbytes;
while(b-- > 0) {
key->utf8[b] = codepoint & 0x3f;
while(b > 1) {
b--;
key->utf8[b] = 0x80 | (codepoint & 0x3f);
codepoint >>= 6;
}