You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-06 08:49:29 +02:00
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.
This commit is contained in:
@@ -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) ||
|
||||
(configLocal->option[optionId].group && optionIdx <
|
||||
configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal));
|
||||
!cfgOptionValid(optionId) ||
|
||||
((!configLocal->option[optionId].group && optionIdx == 0) ||
|
||||
(configLocal->option[optionId].group && optionIdx <
|
||||
configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal)));
|
||||
|
||||
FUNCTION_TEST_RETURN(cfgOptionValid(optionId) && configLocal->option[optionId].index[optionIdx].value != NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user