diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-05-26 18:01:09 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-05-26 18:01:09 +0100 |
commit | 20d97eb849282ae2ca5ff543f6826d689a07199a (patch) | |
tree | 67d88b1a02e6d8b06c09616ced5fd8d3c6c11903 /key-string.c | |
parent | 95e304d1113410e1deb5245bfe8d55a1cd44a059 (diff) | |
parent | ec7f5305b1a6e5548f0769f988e76b01ec293dcc (diff) | |
download | rtmux-20d97eb849282ae2ca5ff543f6826d689a07199a.tar.gz rtmux-20d97eb849282ae2ca5ff543f6826d689a07199a.tar.bz2 rtmux-20d97eb849282ae2ca5ff543f6826d689a07199a.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'key-string.c')
-rw-r--r-- | key-string.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/key-string.c b/key-string.c index bbbe346c..ef5cf17c 100644 --- a/key-string.c +++ b/key-string.c @@ -146,8 +146,7 @@ key_string_lookup_string(const char *string) { static const char *other = "!#()+,-.0123456789:;<=>?'\r\t"; key_code key; - u_short u; - int size; + u_int u; key_code modifiers; struct utf8_data ud; u_int i; @@ -160,7 +159,9 @@ key_string_lookup_string(const char *string) /* Is this a hexadecimal value? */ if (string[0] == '0' && string[1] == 'x') { - if (sscanf(string + 2, "%hx%n", &u, &size) != 1 || size > 4) + if (sscanf(string + 2, "%x", &u) != 1) + return (KEYC_UNKNOWN); + if (u > 0x1fffff) return (KEYC_UNKNOWN); return (u); } |