From 5f3e919734923bb1950f0ef1115e335addedc249 Mon Sep 17 00:00:00 2001 From: ugol Date: Thu, 3 Oct 2024 18:07:02 +0200 Subject: [PATCH] bug: fixed bug when using function RandomString and RandomStringVocabulary with min = max --- pkg/functions/nonsense.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/functions/nonsense.go b/pkg/functions/nonsense.go index c70b6b80..7a8ae6ab 100644 --- a/pkg/functions/nonsense.go +++ b/pkg/functions/nonsense.go @@ -220,7 +220,7 @@ func RandomString(min, max int) string { // RandomStringVocabulary returns a random string long between min and max characters using a vocabulary func RandomStringVocabulary(min, max int, source string) string { - textb := make([]byte, min+Random.Intn(max-min)) + textb := make([]byte, min+Random.Intn(max-min+1)) for i := range textb { textb[i] = source[Random.Intn(len(source))] }