Add cfgOptionValid() check to assert in cfgOptionIdxTest().
Skip the rest of the assert if the option is not valid since this function is intended to work with invalid options.
@@ -1206,9 +1206,10 @@ cfgOptionIdxTest(ConfigOption optionId, unsigned int optionIdx)
ASSERT(optionId < CFG_OPTION_TOTAL);
ASSERT(configLocal != NULL);
ASSERT(
- (!configLocal->option[optionId].group && optionIdx == 0) ||
+ !cfgOptionValid(optionId) ||
+ ((!configLocal->option[optionId].group && optionIdx == 0) ||
(configLocal->option[optionId].group && optionIdx <
- configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal));
+ configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal)));
FUNCTION_TEST_RETURN(cfgOptionValid(optionId) && configLocal->option[optionId].index[optionIdx].value != NULL);
}
