diff options
Diffstat (limited to 'prog/rotation.go')
| -rw-r--r-- | prog/rotation.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/prog/rotation.go b/prog/rotation.go index 8ec9f1947..85513e8c8 100644 --- a/prog/rotation.go +++ b/prog/rotation.go @@ -110,17 +110,10 @@ func MakeRotator(target *Target, calls map[*Syscall]bool, rnd *rand.Rand) *Rotat // However, we assume that 200 syscalls is enough for a fuzzing session, // so we cap at that level to make fuzzing more targeted. r.goal = len(calls) * 19 / 20 - if r.goal < 1 { - r.goal = 1 - } - if max := 200; r.goal > max { - r.goal = max - } + r.goal = max(r.goal, 1) + r.goal = min(r.goal, 200) // How many syscalls that don't use any resources we want to add? - r.nresourceless = r.goal * len(r.resourceless) / len(calls) - if r.nresourceless < 1 { - r.nresourceless = 1 - } + r.nresourceless = max(1, r.goal*len(r.resourceless)/len(calls)) return r } |
