Skip to content

Commit

Permalink
Fix off by one error in cmdline repo priority range check
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Sep 20, 2023
1 parent 52c8a9a commit 9c3f190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cmdline/Action/Repo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private int SetRepositoryPriority(RepoPriorityOptions options)
return Exit.BADOPT;
}
var manager = RegistryManager.Instance(MainClass.GetGameInstance(Manager), repoData);
if (options.priority < 0 || options.priority > manager.registry.Repositories.Count)
if (options.priority < 0 || options.priority >= manager.registry.Repositories.Count)
{
User.RaiseMessage(Properties.Resources.RepoPriorityInvalid,
options.priority, manager.registry.Repositories.Count - 1);
Expand Down

0 comments on commit 9c3f190

Please sign in to comment.