This commit is contained in:
Promi 2017-12-09 15:51:57 +01:00
parent 7ab3357675
commit 5615694ea0
1 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,9 @@ void SetupInput()
size_needed = snprintf(NULL, 0, EVDEV_MAPPING_CONFIG_KEY, port+1) + 1;
evdev_config_key = (char*)malloc(size_needed);
sprintf(evdev_config_key, EVDEV_MAPPING_CONFIG_KEY, port+1);
const char* mapping = (cfgExists("input", evdev_config_key) == 2 ? cfgLoadStr("input", evdev_config_key, "").c_str() : NULL);
string tmp;
const char* mapping = (cfgExists("input", evdev_config_key) == 2 ? (tmp = cfgLoadStr("input", evdev_config_key, "")).c_str() : NULL);
free(evdev_config_key);
input_evdev_init(&evdev_controllers[port], evdev_device, mapping);