From 4978ed7675ba671db546ce3f16e464e5f2f4a7c8 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:44:01 +0200 Subject: [PATCH] rcinput: fix getKeyName for RC_none case --- src/driver/rcinput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index abc4595a6..0554597ce 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1678,9 +1678,14 @@ const char * CRCInput::getSpecialKeyName(const unsigned int key) std::string CRCInput::getKeyName(const unsigned int key) { - std::string res(getKeyNameC(key & ~RC_Repeat)); - if ((key & RC_Repeat) && res != "unknown") - res += " (long)"; + std::string res; + if (key > RC_MaxRC) + res = getKeyNameC(key); /* will only resolve RC_nokey or "unknown" */ + else { + res = (getKeyNameC(key & ~RC_Repeat)); + if ((key & RC_Repeat) && res != "unknown") + res += " (long)"; + } return res; }