repochecker: Fix number of detected choices with step attribute

This commit is contained in:
nemunaire 2023-11-04 09:32:37 +01:00
commit f328261ea2
2 changed files with 1 additions and 2 deletions

View file

@ -39,7 +39,7 @@ func EPITACheckKeyFlag(flag *fic.FlagKey, raw string, _ *fic.Exercice, exception
errs = append(errs, err)
} else if min == nil || max == nil || step == nil {
errs = append(errs, fmt.Errorf("please define min and max for your number flag"))
} else if (*max-*min)**step <= 10 {
} else if (*max-*min) / *step <= 10 {
errs = append(errs, fmt.Errorf("to avoid bruteforce, define more than 10 possibilities"))
}
}