diff --git a/configuration.c b/configuration.c
index 82097b6a32..b840f4b15c 100644
--- a/configuration.c
+++ b/configuration.c
@@ -14,12 +14,14 @@
* If not, see .
*/
+#include
+
#include
+#include
#include
#include
-#include
+
#include "config.def.h"
-#include
#include "input/input_common.h"
#include "input/input_keymaps.h"
#include "input/input_remapping.h"
@@ -2058,7 +2060,8 @@ static void save_keybind_key(config_file_t *conf, const char *prefix,
char key[64] = {0};
char btn[64] = {0};
- snprintf(key, sizeof(key), "%s_%s", prefix, base);
+ fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
+
input_keymaps_translate_rk_to_str(bind->key, btn, sizeof(btn));
config_set_string(conf, key, btn);
}
@@ -2101,7 +2104,8 @@ static void save_keybind_joykey(config_file_t *conf, const char *prefix,
{
char key[64] = {0};
- snprintf(key, sizeof(key), "%s_%s_btn", prefix, base);
+ fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
+ strlcat(key, "_btn", sizeof(key));
if (bind->joykey == NO_BTN)
config_set_string(conf, key, "nul");
@@ -2119,7 +2123,8 @@ static void save_keybind_axis(config_file_t *conf, const char *prefix,
unsigned axis = 0;
char dir = '\0';
- snprintf(key, sizeof(key), "%s_%s_axis", prefix, base);
+ fill_pathname_join_delim(key, prefix, base, '_', sizeof(key));
+ strlcat(key, "_axis", sizeof(key));
if (bind->joyaxis == AXIS_NONE)
config_set_string(conf, key, "nul");