scpi-parser icon indicating copy to clipboard operation
scpi-parser copied to clipboard

TEST_Chanlst upper limit fails

Open djfarrell opened this issue 1 year ago • 1 comments
trafficstars

The TEST_Chanlst function uses if(arr_idx >= (MAXROW * MAXCOL)) in several places, this test fails to allow the last points to be accessed, it looks like the test should be ">" not ">=".

djfarrell avatar Jan 28 '24 17:01 djfarrell

if(arr_idx >= (MAXROW * MAXCOL)) is used to test the out of range of arr_idx. As the last index is at MAXROW * MAXCOL - 1, the next not allowed index is MAXROW * MAXCOL, so this is not an error.

ecrin4102 avatar Feb 02 '24 07:02 ecrin4102