Fixed freeing strings created by strdup() with SDL_free().

This only worked on platforms where SDL_free() wraps free().
This commit is contained in:
Philipp Wiesemann 2016-06-28 21:08:23 +02:00
parent 71e7b716dc
commit 38b769cbe1
3 changed files with 8 additions and 8 deletions

View file

@ -74,8 +74,8 @@ extern "C"
if (joystick.Open(name) != B_ERROR) {
BString stick_name;
joystick.GetControllerName(&stick_name);
SDL_joyport[SDL_SYS_numjoysticks] = strdup(name);
SDL_joyname[SDL_SYS_numjoysticks] = strdup(stick_name.String());
SDL_joyport[SDL_SYS_numjoysticks] = SDL_strdup(name);
SDL_joyname[SDL_SYS_numjoysticks] = SDL_strdup(stick_name.String());
SDL_SYS_numjoysticks++;
joystick.Close();
}