aboutsummaryrefslogtreecommitdiff
path: root/tty-keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'tty-keys.c')
-rw-r--r--tty-keys.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 068c502f..3eb8d428 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -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);