mirror of
https://github.com/miekg/dns.git
synced 2025-12-13 15:51:21 +01:00
Fix some typos
This commit is contained in:
parent
b651c7ea1f
commit
55aa4480c7
11
labels.go
11
labels.go
@ -9,13 +9,10 @@ package dns
|
|||||||
// SplitDomainName splits a name string into it's labels.
|
// SplitDomainName splits a name string into it's labels.
|
||||||
// www.miek.nl. returns []string{"www", "miek", "nl"}
|
// www.miek.nl. returns []string{"www", "miek", "nl"}
|
||||||
// The root label (.) returns nil.
|
// The root label (.) returns nil.
|
||||||
func SplitDomainName(s string) []string {
|
func SplitDomainName(s string) (labels []string) {
|
||||||
var (
|
fqdnEnd := 0 // offset of the final '.' or the length of the name
|
||||||
labels []string
|
idx := Split(s)
|
||||||
fqdnEnd int // offset of the final '.' or the length of the name
|
begin := 0
|
||||||
idx = Split(s)
|
|
||||||
begin = 0
|
|
||||||
)
|
|
||||||
|
|
||||||
if s[len(s)-1] == '.' {
|
if s[len(s)-1] == '.' {
|
||||||
fqdnEnd = len(s) - 1
|
fqdnEnd = len(s) - 1
|
||||||
|
|||||||
2
msg.go
2
msg.go
@ -1255,7 +1255,7 @@ func (dns *Msg) Pack() (msg []byte, err error) {
|
|||||||
dh.Nscount = uint16(len(ns))
|
dh.Nscount = uint16(len(ns))
|
||||||
dh.Arcount = uint16(len(extra))
|
dh.Arcount = uint16(len(extra))
|
||||||
|
|
||||||
msg = make([]byte, dns.packLen()+10) // TODO(miekg): +10 should go sometimses
|
msg = make([]byte, dns.packLen()+10) // TODO(miekg): +10 should go soon
|
||||||
// Pack it in: header and then the pieces.
|
// Pack it in: header and then the pieces.
|
||||||
off := 0
|
off := 0
|
||||||
off, err = packStructCompress(&dh, msg, off, compression, dns.Compress)
|
off, err = packStructCompress(&dh, msg, off, compression, dns.Compress)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user