Array out of bounds! [win32]

Archives Forums/MaxGUI Bug Reports/Array out of bounds! [win32]

Brucey(Posted 2016) [#1]
There's a bug in win32maxguiex.bmx, MouseProc().

Is it using a global array :
Global intButtonStates%[3]


accessing the by MOUSE_xxxx indexes. eg.
If intButtonStates[MOUSE_RIGHT] Then wp:|MK_RBUTTON


Unfortunately, the indexes start at 1 :
Const MOUSE_LEFT=1
Const MOUSE_RIGHT=2
Const MOUSE_MIDDLE=3


Since MouseProc() is declared with "nodebug", this issue never appears when running in debug.

A fix would be to increase the size of intButtonStates[] to accommodate the used indexes.

:o)


skidracer(Posted 2016) [#2]
Eek, thanks Brucey.