diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 557108fc5..3981477fb 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(jid, GLFW_CONNECTED); }