changeset 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 de0351c47596
children 42ed44b2c8b6
files src/joystick/SDL_joystick.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/joystick/SDL_joystick.c	Fri Sep 05 15:20:47 2003 +0000
+++ b/src/joystick/SDL_joystick.c	Sat Sep 13 02:20:32 2003 +0000
@@ -63,8 +63,8 @@
 			SDL_numjoysticks = 0;
 		} else {
 			memset(SDL_joysticks, 0, arraylen);
+			SDL_numjoysticks = status;
 		}
-		SDL_numjoysticks = status;
 		status = 0;
 	}
 	default_joystick = NULL;