aboutsummaryrefslogtreecommitdiff
path: root/key-string.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-05-26 08:42:55 +0100
committerThomas Adam <thomas@xteddy.org>2020-05-26 08:42:55 +0100
commit967e5f8be3d89c6b604484d3b7b2a1ff25db06a5 (patch)
treeabdf31d46ae31d0bf7b705454e7bf86ccebc06b9 /key-string.c
parentfd4d3e87938206d8d05509162c3f3a3c274bb478 (diff)
parent6f03e49e68dfe0d9c0c7d49079c4383b26aca916 (diff)
downloadrtmux-967e5f8be3d89c6b604484d3b7b2a1ff25db06a5.tar.gz
rtmux-967e5f8be3d89c6b604484d3b7b2a1ff25db06a5.tar.bz2
rtmux-967e5f8be3d89c6b604484d3b7b2a1ff25db06a5.zip
Merge branch 'obsd-master'
Diffstat (limited to 'key-string.c')
-rw-r--r--key-string.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/key-string.c b/key-string.c
index 1efb6e0b..4ee12145 100644
--- a/key-string.c
+++ b/key-string.c
@@ -169,7 +169,7 @@ key_string_lookup_string(const char *string)
struct utf8_data ud;
u_int i;
enum utf8_state more;
- wchar_t wc;
+ utf8_char uc;
/* Is this no key or any key? */
if (strcasecmp(string, "None") == 0)
@@ -210,9 +210,9 @@ key_string_lookup_string(const char *string)
more = utf8_append(&ud, (u_char)string[i]);
if (more != UTF8_DONE)
return (KEYC_UNKNOWN);
- if (utf8_combine(&ud, &wc) != UTF8_DONE)
+ if (utf8_from_data(&ud, &uc) != UTF8_DONE)
return (KEYC_UNKNOWN);
- return (wc|modifiers);
+ return (uc|modifiers);
}
/* Otherwise look the key up in the table. */
@@ -349,12 +349,11 @@ key_string_lookup_key(key_code key, int with_flags)
/* Is this a UTF-8 key? */
if (key > 127 && key < KEYC_BASE) {
- if (utf8_split(key, &ud) == UTF8_DONE) {
- off = strlen(out);
- memcpy(out + off, ud.data, ud.size);
- out[off + ud.size] = '\0';
- goto out;
- }
+ utf8_to_data(key, &ud);
+ off = strlen(out);
+ memcpy(out + off, ud.data, ud.size);
+ out[off + ud.size] = '\0';
+ goto out;
}
/* Invalid keys are errors. */