Mercurial > sdl-ios-xcode
comparison src/haptic/SDL_haptic.c @ 2524:1a55848ce198 gsoc2008_force_feedback
Better handling of opening haptics from joysticks.
Fixed segfault when opening from joystick.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 17 Jul 2008 16:07:20 +0000 |
parents | 366d84fdf8d1 |
children | 2d88b82ce781 |
comparison
equal
deleted
inserted
replaced
2523:366d84fdf8d1 | 2524:1a55848ce198 |
---|---|
272 SDL_OutOfMemory(); | 272 SDL_OutOfMemory(); |
273 return NULL; | 273 return NULL; |
274 } | 274 } |
275 | 275 |
276 /* Initialize the haptic device */ | 276 /* Initialize the haptic device */ |
277 SDL_memset(haptic, 0, (sizeof *haptic)); | 277 SDL_memset(haptic, 0, sizeof(SDL_Haptic)); |
278 if (SDL_SYS_HapticOpenFromJoystick(haptic,joystick) < 0) { | 278 if (SDL_SYS_HapticOpenFromJoystick(haptic,joystick) < 0) { |
279 SDL_free(haptic); | 279 SDL_free(haptic); |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 | 282 |