From 43854664b51c94e8cb73a535dd176311208486e8 Mon Sep 17 00:00:00 2001 From: ExpoSeed Date: Fri, 7 May 2021 13:50:50 -0500 Subject: [PATCH] Fix UB in RotatingGate_RotateInDirection --- src/rotating_gate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rotating_gate.c b/src/rotating_gate.c index 22a0b0bdfa..36c23c2a56 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -670,7 +670,8 @@ static void RotatingGate_RotateInDirection(u8 gateId, u32 rotationDirection) } else { - orientation = ++orientation % GATE_ORIENTATION_MAX; + orientation++; + orientation = orientation % GATE_ORIENTATION_MAX; } RotatingGate_SetGateOrientation(gateId, orientation); }