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); }