Fix off-by-one error in "scramble spec" validation (#1144)

This commit is contained in:
Evie
2023-06-16 03:28:19 -04:00
committed by GitHub
parent 9748524ef6
commit a0dfa916e6

View File

@@ -310,7 +310,7 @@ static void parseScrambleSpec(char const *spec)
} }
spec = endptr; spec = endptr;
if (region != SCRAMBLE_UNK && limit >= scrambleSpecs[region].max) { if (region != SCRAMBLE_UNK && limit > scrambleSpecs[region].max) {
argErr('S', "Limit for region \"%.*s\" may not exceed %" PRIu16, argErr('S', "Limit for region \"%.*s\" may not exceed %" PRIu16,
regionNamePrintLen, regionName, scrambleSpecs[region].max); regionNamePrintLen, regionName, scrambleSpecs[region].max);
limit = scrambleSpecs[region].max; limit = scrambleSpecs[region].max;