mirror of
https://github.com/golang/net.git
synced 2026-03-31 02:17:08 +09:00
icmp, webdav/internal/xml: avoid string(int)
Updates golang/go#32479 Change-Id: Ife0c3a2f10afb676af5f2110a9681216122c8808 Reviewed-on: https://go-review.googlesource.com/c/net/+/233900 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
@@ -300,7 +300,7 @@ func parseInterfaceIdent(b []byte) (Extension, error) {
|
||||
}
|
||||
switch ifi.Type {
|
||||
case typeInterfaceByName:
|
||||
ifi.Name = strings.Trim(string(b[4:]), string(0))
|
||||
ifi.Name = strings.Trim(string(b[4:]), "\x00")
|
||||
case typeInterfaceByIndex:
|
||||
if len(b[4:]) < 4 {
|
||||
return nil, errInvalidExtension
|
||||
|
||||
@@ -945,7 +945,7 @@ func (d *Decoder) ungetc(b byte) {
|
||||
d.offset--
|
||||
}
|
||||
|
||||
var entity = map[string]int{
|
||||
var entity = map[string]rune{
|
||||
"lt": '<',
|
||||
"gt": '>',
|
||||
"amp": '&',
|
||||
@@ -1040,7 +1040,7 @@ Input:
|
||||
d.buf.WriteByte(';')
|
||||
n, err := strconv.ParseUint(s, base, 64)
|
||||
if err == nil && n <= unicode.MaxRune {
|
||||
text = string(n)
|
||||
text = string(rune(n))
|
||||
haveText = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user