Mercurial > sdl-ios-xcode
comparison src/joystick/SDL_joystick.c @ 716:f25e3334d583
SDL_JoystickInit: If malloc() fails, pretend no joysticks were detected.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 13 Sep 2003 02:20:32 +0000 |
parents | f6ffac90895c |
children | b8d311d90021 |
comparison
equal
deleted
inserted
replaced
715:de0351c47596 | 716:f25e3334d583 |
---|---|
61 SDL_joysticks = (SDL_Joystick **)malloc(arraylen); | 61 SDL_joysticks = (SDL_Joystick **)malloc(arraylen); |
62 if ( SDL_joysticks == NULL ) { | 62 if ( SDL_joysticks == NULL ) { |
63 SDL_numjoysticks = 0; | 63 SDL_numjoysticks = 0; |
64 } else { | 64 } else { |
65 memset(SDL_joysticks, 0, arraylen); | 65 memset(SDL_joysticks, 0, arraylen); |
66 } | 66 SDL_numjoysticks = status; |
67 SDL_numjoysticks = status; | 67 } |
68 status = 0; | 68 status = 0; |
69 } | 69 } |
70 default_joystick = NULL; | 70 default_joystick = NULL; |
71 return(status); | 71 return(status); |
72 } | 72 } |