From 85d5705c776e6110095403a0cf49dc7ed96dafa9 Mon Sep 17 00:00:00 2001 From: TheArrayser Date: Sun, 12 Jan 2025 14:47:16 +0100 Subject: [PATCH] fix -1 --- prime.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prime.go b/prime.go index 8072585..28eba38 100644 --- a/prime.go +++ b/prime.go @@ -53,7 +53,7 @@ func HandlePrimeNumberChecker(question dns.Question) dns.RR { return nil } - mainDomainPart := question.Name[0 : mainDomainPartindex-1] // subtract 1 for the p in prime + mainDomainPart := question.Name[0:mainDomainPartindex] // subtract 1 for the p in prime log.Println("10:" + mainDomainPart) if !strings.HasSuffix(mainDomainPart, ".") { @@ -62,7 +62,7 @@ func HandlePrimeNumberChecker(question dns.Question) dns.RR { return nil } - mainDomainPart = mainDomainPart[0 : len(mainDomainPart)-2] // subtract 1 to accomodate for the length being one bigger then the last index, and subtract another one for the dot at the end + mainDomainPart = mainDomainPart[0 : len(mainDomainPart)-1] // subtract 1 to accomodate for the length being one bigger then the last index, and subtract another one for the dot at the end log.Println("12:" + mainDomainPart) if len(mainDomainPart) == 0 { @@ -77,7 +77,7 @@ func HandlePrimeNumberChecker(question dns.Question) dns.RR { if firstIsIndex == 0 || firstIsIndex == 1 { // word "is." found at the beginning of the question.. trim - mainDomainPart = mainDomainPart[len("is.") : len(mainDomainPart)-1] + mainDomainPart = mainDomainPart[len("is."):len(mainDomainPart)] } log.Println("15: " + mainDomainPart)