From c2b01d6c50108d64084c4c8edcdb2e291ce6d8ed Mon Sep 17 00:00:00 2001 From: endolf Date: Mon, 7 Nov 2005 07:46:34 +0000 Subject: Handle cases where there are no event devices, only js ones. git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@128 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- plugins/linux/src/native/jinput.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins/linux/src/native/jinput.cpp') diff --git a/plugins/linux/src/native/jinput.cpp b/plugins/linux/src/native/jinput.cpp index 4140616..2123d0b 100644 --- a/plugins/linux/src/native/jinput.cpp +++ b/plugins/linux/src/native/jinput.cpp @@ -78,7 +78,7 @@ JNIEXPORT jint JNICALL Java_net_java_games_input_JInputLibrary_nativeInit int i; int j; int joystickPtr = 0; - jinputDeviceList = (Device **)malloc(numEventDevices * sizeof(Device *)); + jinputDeviceList = (Device **)malloc((numEventDevices + numJoysticks) * sizeof(Device *)); for(i=0;i