Fix out-of-bounds access in genRangeInclusive

This commit is contained in:
2025-01-30 09:09:20 -05:00
parent b9da5ec08d
commit 368941e5c7

View File

@@ -99,7 +99,7 @@ func Reduce[T any](slc []T, fn func(T, T) T) T {
// Generate numbers in a range - start to end (both inclusive)
func genRangeInclusive[T character](start, end T) []T {
toRet := make([]T, end-start)
toRet := make([]T, (end-start)+1)
for i := start; i <= end; i++ {
toRet[i-start] = i
}