1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-30 05:39:12 +02:00

Cast result of cfgParseOptionId() to int.

It would probably make more sense to add an "invalid" enum value, but at least fix the cast for now. The function was originally designed to interface with Perl which required -1 in this case.

Found on MacOS M1.
This commit is contained in:
David Steele 2021-01-21 17:29:24 -05:00
parent 3f72eca909
commit 0869b8afff

View File

@ -476,7 +476,7 @@ cfgParseOptionId(const char *optionName)
for (ConfigOption optionId = 0; optionId < CFG_OPTION_TOTAL; optionId++)
if (strcmp(optionName, parseRuleOption[optionId].name) == 0)
result = optionId;
result = (int)optionId;
FUNCTION_TEST_RETURN(result);
}