From 60f2848421335556adeaa7f409c24714bcaf40f0 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 7 May 2017 21:02:46 +0200 Subject: [PATCH] haiku: Fixed crash on quit if max number of joysticks was connected. --- src/joystick/haiku/SDL_haikujoystick.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/joystick/haiku/SDL_haikujoystick.cc b/src/joystick/haiku/SDL_haikujoystick.cc index fa3234cd5..9d7c0c3c8 100644 --- a/src/joystick/haiku/SDL_haikujoystick.cc +++ b/src/joystick/haiku/SDL_haikujoystick.cc @@ -228,12 +228,12 @@ extern "C" { int i; - for (i = 0; SDL_joyport[i]; ++i) { + for (i = 0; i < SDL_SYS_numjoysticks; ++i) { SDL_free(SDL_joyport[i]); } SDL_joyport[0] = NULL; - for (i = 0; SDL_joyname[i]; ++i) { + for (i = 0; i < SDL_SYS_numjoysticks; ++i) { SDL_free(SDL_joyname[i]); } SDL_joyname[0] = NULL;