diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-02-10 18:12:19 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-02-10 18:12:19 +0000 |
commit | 516a1766a59b4abec389e8ed4eadf666701f356e (patch) | |
tree | 2009ebad7861e66c210fa8e6e0c6b61248efaf17 | |
parent | 98840316257bc66a35a6c1db27697763fbf73a46 (diff) | |
download | termo-516a1766a59b4abec389e8ed4eadf666701f356e.tar.gz termo-516a1766a59b4abec389e8ed4eadf666701f356e.tar.xz termo-516a1766a59b4abec389e8ed4eadf666701f356e.zip |
Bugfix to fill_utf8() to make it actually work right
-rw-r--r-- | termkey.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |