j123b567 / scpi-parser

Open Source SCPI device library
BSD 2-Clause "Simplified" License
447 stars 191 forks source link

TEST_Chanlst upper limit fails #156

Open djfarrell opened 5 months ago

djfarrell commented 5 months ago

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 ">=".

ecrin4102 commented 5 months ago

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.