fix(hwgen): prevent prefix collisions when resolving source names (#7533)

This commit is contained in:
norulers
2026-07-10 13:40:01 +10:00
committed by GitHub
parent 7f228ffec1
commit df1f8270bb
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -549,7 +549,8 @@ int adcGetInputIdx(const char* input, uint8_t len)
do {
for (uint8_t i = 0; i < _hal_adc_inputs[type].n_inputs; i++, idx++) {
if (!strncmp(_hal_adc_inputs[type].inputs[i].name, input, len))
const char* input_name = _hal_adc_inputs[type].inputs[i].name;
if (strlen(input_name) == len && !strncmp(input_name, input, len))
return idx;
}
} while (++type < ADC_INPUT_ALL);