# HG changeset patch # User Sam Lantinga # Date 1353996574 28800 # Node ID 73e2ad636f6ead76f8897cc831be721447cbd0a4 # Parent ec21e81c62aa78808b049e2bd9ec685af63025c8 Return an error if the joystick index isn't 0 on Android diff -r ec21e81c62aa -r 73e2ad636f6e src/joystick/android/SDL_sysjoystick.c --- a/src/joystick/android/SDL_sysjoystick.c Mon Nov 26 22:02:01 2012 -0800 +++ b/src/joystick/android/SDL_sysjoystick.c Mon Nov 26 22:09:34 2012 -0800 @@ -64,13 +64,18 @@ It returns 0, or -1 if there is an error. */ int -SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int index) +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) { - joystick->nbuttons = 0; - joystick->nhats = 0; - joystick->nballs = 0; - joystick->naxes = 3; - return 0; + if (device_index == 0) { + joystick->nbuttons = 0; + joystick->nhats = 0; + joystick->nballs = 0; + joystick->naxes = 3; + return 0; + } else { + SDL_SetError("No joystick available with that index"); + return (-1); + } }