Assume malloc works.

This commit is contained in:
Camilla Berglund
2013-03-11 21:30:01 +01:00
parent 51ee3a5c0a
commit 26e8fde8fb
3 changed files with 1 additions and 43 deletions
-16
View File
@@ -81,23 +81,7 @@ static int openJoystickDevice(int joy, const char* path)
_glfw.x11.joystick[joy].numButtons = (int) numButtons;
_glfw.x11.joystick[joy].axis = (float*) malloc(sizeof(float) * numAxes);
if (_glfw.x11.joystick[joy].axis == NULL)
{
close(fd);
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
return GL_FALSE;
}
_glfw.x11.joystick[joy].button = (unsigned char*) malloc(numButtons);
if (_glfw.x11.joystick[joy].button == NULL)
{
free(_glfw.x11.joystick[joy].axis);
close(fd);
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
return GL_FALSE;
}
_glfw.x11.joystick[joy].present = GL_TRUE;
#endif // __linux__