From 414d366cb2cfe0d99ef62855692db3b4523ebb12 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 19 Jan 2018 12:33:27 +0100 Subject: [PATCH] Print the root zone as a dot rather than an empty string Fixes #7 --- dnscrypt-proxy/dnsutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/dnsutils.go b/dnscrypt-proxy/dnsutils.go index bf915875..6ee90b7c 100644 --- a/dnscrypt-proxy/dnsutils.go +++ b/dnscrypt-proxy/dnsutils.go @@ -52,7 +52,7 @@ func NormalizeName(name *[]byte) { } func StripTrailingDot(str string) string { - if strings.HasSuffix(str, ".") { + if len(str) > 1 && strings.HasSuffix(str, ".") { str = str[:len(str)-1] } return str