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 2f016cf88d
commit 6ec5e64056
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();
}