diff options
author | nicm <nicm> | 2015-10-26 22:03:04 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-10-26 22:03:04 +0000 |
commit | b85be36d1cb96e0328b3f1dc9388288989d3b8e5 (patch) | |
tree | 4b8bf85bee0c84f261d95b6221847d7745c3b576 /key-string.c | |
parent | a22fe33aa00d4e29e8d71b58b8f728d83e5d23f3 (diff) | |
download | rtmux-b85be36d1cb96e0328b3f1dc9388288989d3b8e5.tar.gz rtmux-b85be36d1cb96e0328b3f1dc9388288989d3b8e5.tar.bz2 rtmux-b85be36d1cb96e0328b3f1dc9388288989d3b8e5.zip |
Handle unknown keys more gracefully, return a string instead of NULL.
Diffstat (limited to 'key-string.c')
-rw-r--r-- | key-string.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/key-string.c b/key-string.c index b6474c4f..88cd2a32 100644 --- a/key-string.c +++ b/key-string.c @@ -238,8 +238,10 @@ key_string_lookup_key(int key) } /* Invalid keys are errors. */ - if (key == 127 || key > 255) - return (NULL); + if (key == 127 || key > 255) { + snprintf(out, sizeof out, "<INVALID#%04x>", key); + return (out); + } /* Check for standard or control key. */ if (key >= 0 && key <= 32) { |