haiku: Fixed crash on quit if max number of joysticks was connected.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 07 May 2017 21:02:46 +0200
changeset 1099450ffb2b7ee1c
parent 10993 0283fa2192cd
child 10995 b2a06697db74
haiku: Fixed crash on quit if max number of joysticks was connected.
src/joystick/haiku/SDL_haikujoystick.cc
     1.1 --- a/src/joystick/haiku/SDL_haikujoystick.cc	Sun May 07 21:02:31 2017 +0200
     1.2 +++ b/src/joystick/haiku/SDL_haikujoystick.cc	Sun May 07 21:02:46 2017 +0200
     1.3 @@ -228,12 +228,12 @@
     1.4      {
     1.5          int i;
     1.6  
     1.7 -        for (i = 0; SDL_joyport[i]; ++i) {
     1.8 +        for (i = 0; i < SDL_SYS_numjoysticks; ++i) {
     1.9              SDL_free(SDL_joyport[i]);
    1.10          }
    1.11          SDL_joyport[0] = NULL;
    1.12  
    1.13 -        for (i = 0; SDL_joyname[i]; ++i) {
    1.14 +        for (i = 0; i < SDL_SYS_numjoysticks; ++i) {
    1.15              SDL_free(SDL_joyname[i]);
    1.16          }
    1.17          SDL_joyname[0] = NULL;