Browse Source
Fix cppcheck warnings where array elements were accessed before validating their indices. Reorder conditional expressions to ensure bounds checks are performed before array accesses, taking advantage of C++ short-circuit evaluation. In EMNR::NP::interpM(), check the index limit before accessing xvals[idx]. In SNBA::scanFrame(), verify i is within the merit array bounds before evaluating merit[i]. These changes improve defensive programming practices and prevent potential undefined behavior if an index exceeds the valid range. No functional changes. Signed-off-by: Robin Getz <rgetz503@gmail.com>chirpmodem-v8.0.0
2 changed files with 2 additions and 2 deletions
Loading…
Reference in new issue