SDL_JoystickInit: If malloc() fails, pretend no joysticks were detected.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 13 Sep 2003 02:20:32 +0000
changeset 716 f25e3334d583
parent 715 de0351c47596
child 717 42ed44b2c8b6
SDL_JoystickInit: If malloc() fails, pretend no joysticks were detected.
src/joystick/SDL_joystick.c
--- 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;