src/joystick/SDL_joystick.c
changeset 7294 0923de98a63a
parent 7279 f7805b13b485
child 7297 c43b23f0c000
equal deleted inserted replaced
7293:341d22fe9044 7294:0923de98a63a
   727 
   727 
   728 
   728 
   729 /* return the guid for this index */
   729 /* return the guid for this index */
   730 SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
   730 SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
   731 {
   731 {
       
   732     if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
       
   733         SDL_JoystickGUID emptyGUID;
       
   734         SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
       
   735         SDL_zero( emptyGUID );
       
   736         return emptyGUID;
       
   737     }
   732     return SDL_SYS_JoystickGetDeviceGUID( device_index );
   738     return SDL_SYS_JoystickGetDeviceGUID( device_index );
   733 }
   739 }
   734 
   740 
   735 /* return the guid for this opened device */
   741 /* return the guid for this opened device */
   736 SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
   742 SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)