Audit changes.

This commit is contained in:
jdl
2026-06-11 16:46:38 +02:00
parent cd2ec23ccb
commit 82a6d47bc9
17 changed files with 133 additions and 71 deletions

View File

@@ -55,9 +55,9 @@ func updateHosts(hostsPath, localDomain string, peers map[netip.Addr]*Peer) erro
after := ""
if idxBegin := strings.Index(data, begin); idxBegin != -1 {
idxEnd := strings.Index(data, end)
idxEnd := strings.Index(data[idxBegin:], end)
if idxEnd != -1 {
after = strings.TrimSpace(data[idxEnd+len(end):])
after = strings.TrimSpace(data[idxBegin+idxEnd+len(end):])
}
before = strings.TrimSpace(data[:idxBegin])
}