calloc error in cocoa_joystick.m

The calloc call for js->buttons uses 1 instead of sizeof(unsigned char) for the element size.
This commit is contained in:
IntellectualKitty 2016-04-27 06:29:33 -06:00
parent d97044d9ac
commit a9be9bc5fc

View File

@ -322,7 +322,7 @@ static void matchCallback(void* context,
js->axes = calloc(CFArrayGetCount(js->axisElements), sizeof(float)); js->axes = calloc(CFArrayGetCount(js->axisElements), sizeof(float));
js->buttons = calloc(CFArrayGetCount(js->buttonElements) + js->buttons = calloc(CFArrayGetCount(js->buttonElements) +
CFArrayGetCount(js->hatElements) * 4, 1); CFArrayGetCount(js->hatElements) * 4, sizeof(unsigned char));
_glfwInputJoystickChange(joy, GLFW_CONNECTED); _glfwInputJoystickChange(joy, GLFW_CONNECTED);
} }