Tired of the privacy invasion of browsers? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. All Chrome extensions are compatible. None of the telemetry. Auto-blocks ads and still support content creators like me.

I noticed a “bug” in the way Audi handles its Cruise Control options. Cruise control is only meant to be used once you drive “30 kilometers per hour or more”. However, the controls only allow you to activate cruise control at 31km/h. Once the cruise control is active, you can dial it down to 30km/h again.

This seems like there are 2 independent controls happening, each determining how to handle user input.

The source code below is my own. I do not have access to the real Audi on-board controller source code. They are here for demonstration purposes only.

The speed limit seems to be a constant.

const CRUISE_CONTROL_MINIMUM = 30;

But the handling is different. For instance, when you first activate cruise control, this is the check in the function/method/controller (whatever it may be) to validate the input.

if (CURRENT_SPEED > CRUISE_CONTROL_MINIMUM) { /* Current speed exceeds the CRUISE_CONTROL_MINIMUM (more than 30km/h), it's allowed */ CURRENT_CRUISE_CONTROL = CURRENT_SPEED; }

This check makes sure you can only activate cruise control at 31km/h or more.

If you want to change the speed configured on the car, the following check appears to happen.

if (CURRENT_CRUISE_CONTROL >= CRUISE_CONTROL_MINIMUM) { /* Cruis control is set to CRUISE_CONTROL_MINIMUM or higher (30km/h or more), it's allowed */ ... }

This allows you to set the cruise control speed back to 30km/h.

Notice the difference in “>” (greater than) and “>=” (greater than or equals) in the equation. Such a check allows you to set the cruise control to 30km/h, but only after you’ve first enabled it at 31km/h or more.

This seems like something QA should have caught. Unless there are strict car regulations that would only allow cruise control at more than 30km/h? Sounds silly.

If you live in a country with way too many 30km/h zones, you notice this. And it bugs me. Pun intended.