From b3a53ac8caa76f0439c3ee1540232e6ca018904e Mon Sep 17 00:00:00 2001 From: David Walters Date: Fri, 24 Nov 2017 21:36:49 +0000 Subject: [PATCH] Show "---" for unbound controls, not "(Key: )" --- input/input_driver.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 04b3d36238..522f6caab8 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -2511,10 +2511,17 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind, input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key)); if (string_is_equal(key, file_path_str(FILE_PATH_NUL))) *key = '\0'; - - snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key); - strlcat(buf, keybuf, size); + /*empty?*/ + if ( *key != '\0' ) { + snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key); + strlcat(buf, keybuf, size); + } #endif + + /*completely empty?*/ + if ( *buf == '\0' ) { + strlcat(buf, "---", size); + } } const char *input_config_get_device_name(unsigned port)