Vincent Pelletier subdino2004@yahoo.fr writes:
Checks for out-of-range value in "style" (paint_button function): must be style<MAX_BTN_TYPE or memory violation (reading unpredictable btyes) occurs, and as it's then used as a function address that could lead to random code execution.
If you really want an assertion you should use assert(), at least then it can be compiled out. And if it's a condition that can legitimately happen, then it has to be handled properly, just adding an ERR doesn't improve anything. In this case I guess it's conceivable that the app would change the style to an invalid one, so it needs to be handled.