From 2ca5446cd40db9a8cdde085564f72a9f96dfd002 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Aug 2026 11:42:50 -0700 Subject: [PATCH] Fixed reading the factory stick calibration for Nintendo Switch controllers (cherry picked from commit 8d6c456fb347ef966645a457e2751ed489fcb161) --- src/joystick/hidapi/SDL_hidapi_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index 4ac546964a..7580385af0 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -1008,12 +1008,12 @@ static bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx) // Avoid overriding user calibration if it's present for only one stick (known to happen on JoyCons) if (!have_left_stick_cal) { have_left_stick_cal = true; - SDL_memcpy(pLeftStickCal, user_reply->stickFactoryCalibration.rgucLeftCalibration, sizeof(pLeftStickCal)); + SDL_memcpy(pLeftStickCal, factory_reply->stickFactoryCalibration.rgucLeftCalibration, sizeof(pLeftStickCal)); } if (!have_right_stick_cal) { have_right_stick_cal = true; - SDL_memcpy(pRightStickCal, user_reply->stickFactoryCalibration.rgucRightCalibration, sizeof(pRightStickCal)); + SDL_memcpy(pRightStickCal, factory_reply->stickFactoryCalibration.rgucRightCalibration, sizeof(pRightStickCal)); } break;