diff options
author | nicm <nicm> | 2019-02-16 19:04:34 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-02-16 19:04:34 +0000 |
commit | fa33603dc1eca5600aa5c6e0d2f4aa2291a75398 (patch) | |
tree | 23121bdd4f6e00745e5a0f63e8a547b01aecf08b | |
parent | 82f0c859a2bcdfac79d242793b7720b74d62d04b (diff) | |
download | rtmux-fa33603dc1eca5600aa5c6e0d2f4aa2291a75398.tar.gz rtmux-fa33603dc1eca5600aa5c6e0d2f4aa2291a75398.tar.bz2 rtmux-fa33603dc1eca5600aa5c6e0d2f4aa2291a75398.zip |
Do not look at next key byte if the length is 0, originally from Shingo
NISHIOKA in GitHub issue 1601.
-rw-r--r-- | tty-keys.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -464,6 +464,10 @@ tty_keys_find(struct tty *tty, const char *buf, size_t len, size_t *size) static struct tty_key * tty_keys_find1(struct tty_key *tk, const char *buf, size_t len, size_t *size) { + /* If no data, no match. */ + if (len == 0) + return (NULL); + /* If the node is NULL, this is the end of the tree. No match. */ if (tk == NULL) return (NULL); |