From a9be9bc5fc46d153da272a01bc2edc04a8eb24be Mon Sep 17 00:00:00 2001 From: IntellectualKitty Date: Wed, 27 Apr 2016 06:29:33 -0600 Subject: [PATCH] calloc error in cocoa_joystick.m The calloc call for js->buttons uses 1 instead of sizeof(unsigned char) for the element size. --- src/cocoa_joystick.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 0e0a20f5b..03afa8894 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -322,7 +322,7 @@ static void matchCallback(void* context, js->axes = calloc(CFArrayGetCount(js->axisElements), sizeof(float)); js->buttons = calloc(CFArrayGetCount(js->buttonElements) + - CFArrayGetCount(js->hatElements) * 4, 1); + CFArrayGetCount(js->hatElements) * 4, sizeof(unsigned char)); _glfwInputJoystickChange(joy, GLFW_CONNECTED); }