Mercurial > repos > blastem
diff controller_info.c @ 1859:52f136052ab0
Allow changing SDL2 mapping and controller type after initial configuration
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 03 May 2019 18:33:26 -0700 |
parents | a4cae960fd08 |
children | fc05f49075c2 |
line wrap: on
line diff
--- a/controller_info.c Mon Apr 29 19:18:55 2019 -0700 +++ b/controller_info.c Fri May 03 18:33:26 2019 -0700 @@ -195,8 +195,8 @@ char guid_string[33]; SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(render_get_joystick(joystick)), guid_string, sizeof(guid_string)); tern_node *existing = tern_find_node(info_config, guid_string); - existing = tern_insert_ptr(existing, "subtype", (void *)subtype_names[info->subtype]); - existing = tern_insert_ptr(existing, "variant", (void *)variant_names[info->variant]); + existing = tern_insert_ptr(existing, "subtype", strdup(subtype_names[info->subtype])); + existing = tern_insert_ptr(existing, "variant", strdup(variant_names[info->variant])); info_config = tern_insert_node(info_config, guid_string, existing); persist_config_at(config, info_config, "controller_types.cfg"); #endif