diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 1e7e8b595..30afa27c1 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1567,16 +1567,21 @@ const char * CRCInput::getSpecialKeyName(const unsigned int key) } std::string CRCInput::getKeyName(const unsigned int key) +{ + return (std::string)getKeyNameC(key); +} + +const char *CRCInput::getKeyNameC(const unsigned int key) { int lunicode_value = getUnicodeValue(key); if (lunicode_value == -1) return getSpecialKeyName(key); else { - char tmp[2]; + static char tmp[2]; tmp[0] = lunicode_value; tmp[1] = 0; - return std::string(tmp); + return tmp; } } diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index ac773ba06..f4788c98f 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -282,6 +282,7 @@ class CRCInput static int getUnicodeValue(const neutrino_msg_t key); static const char * getSpecialKeyName(const unsigned int key); + static const char *getKeyNameC(const unsigned int key); static std::string getKeyName(const unsigned int key); int addTimer(uint64_t Interval, bool oneshot= true, bool correct_time= true ); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index e0f10c96a..f7427e5c8 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -858,7 +858,7 @@ void CMenuWidget::calcSize() { const char *tmp; if (items[i]->iconName.empty()) - tmp = CRCInput::getKeyName(items[i]->directKey).c_str(); + tmp = CRCInput::getKeyNameC(items[i]->directKey); else tmp = items[i]->iconName.c_str(); int w, h;